Class Config
Stay organized with collections
Save and categorize content based on your preferences.
Config
Contains the configuration entries for a connector. These configuration entries define what
questions are asked when adding a new connector.
const cc = DataStudioApp.createCommunityConnector();
const config = cc.getConfig();
const info_entry = config.newInfo().setId('info_id').setHelpText(
'This connector can connect to multiple data endpoints.');
Detailed documentation
build()
Validates this object and returns it in the format needed by Data Studio.
Return
Object
— The validated Config
object.
newCheckbox()
Returns a new checkbox configuration entry.
Return
Checkbox
— A new checkbox configuration entry.
newInfo()
Returns a new info configuration entry.
Return
Info
— A new info configuration entry.
newOptionBuilder()
Returns a new options builder.
Return
OptionBuilder
— A new options builder.
newSelectMultiple()
Returns a new select multiple configuration entry.
Return
SelectMultiple
— A new select multiple configuration entry.
newSelectSingle()
Returns a new select single configuration entry.
Return
SelectSingle
— A new select single configuration entry.
newTextArea()
Returns a new text area configuration entry.
Return
TextArea
— A new text area configuration entry.
newTextInput()
Returns a new text input configuration entry.
Return
TextInput
— A new text input configuration entry.
printJson()
Prints the JSON representation of this object. This is for debugging only.
Return
String
setDateRangeRequired(dateRangeRequired)
If true
, a date range is provided for getData() requests.
Parameters
Name | Type | Description |
dateRangeRequired | Boolean | Whether or not a date range should be provided to getData()
requests. |
Return
Config
— This builder, for chaining.
setIsSteppedConfig(isSteppedConfig)
If true
, getConfig()
is called again with the current user configuration.
Parameters
Name | Type | Description |
isSteppedConfig | Boolean | The stepped config status to set. |
Return
Config
— This builder, for chaining.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-02 UTC.
[null,null,["Last updated 2024-12-02 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eConfig\u003c/code\u003e object defines the configuration entries for a connector, determining the questions asked when adding a new connector.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods for creating various configuration entry types like checkboxes, text inputs, and select lists.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild()\u003c/code\u003e method validates the configuration and returns it in the required format for Data Studio.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esetDateRangeRequired()\u003c/code\u003e and \u003ccode\u003esetIsSteppedConfig()\u003c/code\u003e methods control whether a date range is provided to data requests and if the configuration is stepped.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods such as \u003ccode\u003eprintJson()\u003c/code\u003e for debugging purposes.\u003c/p\u003e\n"]]],[],null,["# Class Config\n\nConfig\n\nContains the configuration entries for a connector. These configuration entries define what\nquestions are asked when adding a new connector.\n\n```javascript\nconst cc = DataStudioApp.createCommunityConnector();\nconst config = cc.getConfig();\n\nconst info_entry = config.newInfo().setId('info_id').setHelpText(\n 'This connector can connect to multiple data endpoints.');\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------------------------------------|----------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [build()](#build()) | `Object` | Validates this object and returns it in the format needed by Data Studio. |\n| [newCheckbox()](#newCheckbox()) | [Checkbox](/apps-script/reference/data-studio/checkbox) | Returns a new checkbox configuration entry. |\n| [newInfo()](#newInfo()) | [Info](/apps-script/reference/data-studio/info) | Returns a new info configuration entry. |\n| [newOptionBuilder()](#newOptionBuilder()) | [OptionBuilder](/apps-script/reference/data-studio/option-builder) | Returns a new options builder. |\n| [newSelectMultiple()](#newSelectMultiple()) | [SelectMultiple](/apps-script/reference/data-studio/select-multiple) | Returns a new select multiple configuration entry. |\n| [newSelectSingle()](#newSelectSingle()) | [SelectSingle](/apps-script/reference/data-studio/select-single) | Returns a new select single configuration entry. |\n| [newTextArea()](#newTextArea()) | [TextArea](/apps-script/reference/data-studio/text-area) | Returns a new text area configuration entry. |\n| [newTextInput()](#newTextInput()) | [TextInput](/apps-script/reference/data-studio/text-input) | Returns a new text input configuration entry. |\n| [printJson()](#printJson()) | `String` | Prints the JSON representation of this object. |\n| [setDateRangeRequired(dateRangeRequired)](#setDateRangeRequired(Boolean)) | [Config](#) | If `true`, a date range is provided for getData() requests. |\n| [setIsSteppedConfig(isSteppedConfig)](#setIsSteppedConfig(Boolean)) | [Config](#) | If `true`, `get``Config()` is called again with the current user configuration. |\n\nDetailed documentation\n----------------------\n\n### `build()`\n\nValidates this object and returns it in the format needed by Data Studio.\n\n#### Return\n\n\n`Object` --- The validated [Config](#) object.\n\n*** ** * ** ***\n\n### `new``Checkbox()`\n\nReturns a new checkbox configuration entry.\n\n#### Return\n\n\n[Checkbox](/apps-script/reference/data-studio/checkbox) --- A new checkbox configuration entry.\n\n*** ** * ** ***\n\n### `new``Info()`\n\nReturns a new info configuration entry.\n\n#### Return\n\n\n[Info](/apps-script/reference/data-studio/info) --- A new info configuration entry.\n\n*** ** * ** ***\n\n### `new``Option``Builder()`\n\nReturns a new options builder.\n\n#### Return\n\n\n[OptionBuilder](/apps-script/reference/data-studio/option-builder) --- A new options builder.\n\n*** ** * ** ***\n\n### `new``Select``Multiple()`\n\nReturns a new select multiple configuration entry.\n\n#### Return\n\n\n[SelectMultiple](/apps-script/reference/data-studio/select-multiple) --- A new select multiple configuration entry.\n\n*** ** * ** ***\n\n### `new``Select``Single()`\n\nReturns a new select single configuration entry.\n\n#### Return\n\n\n[SelectSingle](/apps-script/reference/data-studio/select-single) --- A new select single configuration entry.\n\n*** ** * ** ***\n\n### `new``Text``Area()`\n\nReturns a new text area configuration entry.\n\n#### Return\n\n\n[TextArea](/apps-script/reference/data-studio/text-area) --- A new text area configuration entry.\n\n*** ** * ** ***\n\n### `new``Text``Input()`\n\nReturns a new text input configuration entry.\n\n#### Return\n\n\n[TextInput](/apps-script/reference/data-studio/text-input) --- A new text input configuration entry.\n\n*** ** * ** ***\n\n### `print``Json()`\n\nPrints the JSON representation of this object. This is for debugging only.\n\n#### Return\n\n\n`String`\n\n*** ** * ** ***\n\n### `set``Date``Range``Required(dateRangeRequired)`\n\nIf `true`, a date range is provided for getData() requests.\n\n#### Parameters\n\n| Name | Type | Description |\n|-------------------------|-----------|---------------------------------------------------------------------------|\n| `date``Range``Required` | `Boolean` | Whether or not a date range should be provided to `get``Data()` requests. |\n\n#### Return\n\n\n[Config](#) --- This builder, for chaining.\n\n*** ** * ** ***\n\n### `set``Is``Stepped``Config(isSteppedConfig)`\n\nIf `true`, `get``Config()` is called again with the current user configuration.\n\n#### Parameters\n\n| Name | Type | Description |\n|-----------------------|-----------|-----------------------------------|\n| `is``Stepped``Config` | `Boolean` | The stepped config status to set. |\n\n#### Return\n\n\n[Config](#) --- This builder, for chaining."]]