Stay organized with collections
Save and categorize content based on your preferences.
CommunityConnector
CommunityConnector enables scripts to access builders and utilities to help with development of
Community Connectors for Data Studio. Use this class to get a reference to the Fields
object and the FieldType and AggregationType enums so they can be used in the
construction of Fields.
Returns a new SetCredentialsResponse object. Use this object to create a response for
the setCredentials() function you implement in your script project.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-02 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eCommunityConnector\u003c/code\u003e class enables scripts to access builders and utilities for developing Community Connectors for Data Studio.\u003c/p\u003e\n"],["\u003cp\u003eIt provides access to \u003ccode\u003eFields\u003c/code\u003e, \u003ccode\u003eFieldType\u003c/code\u003e, and \u003ccode\u003eAggregationType\u003c/code\u003e for constructing \u003ccode\u003eField\u003c/code\u003e objects within your connector.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCommunityConnector\u003c/code\u003e offers methods to manage configurations, define data schemas, handle authentication, and create response objects for various connector functions.\u003c/p\u003e\n"],["\u003cp\u003eIt also allows the creation of user and debug errors for better error handling within your connector.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize methods like \u003ccode\u003egetConfig()\u003c/code\u003e, \u003ccode\u003egetFields()\u003c/code\u003e, and response builders such as \u003ccode\u003enewGetDataResponse()\u003c/code\u003e to interact with and control the connector's behavior.\u003c/p\u003e\n"]]],[],null,["CommunityConnector\n\nCommunityConnector enables scripts to access builders and utilities to help with development of\nCommunity Connectors for Data Studio. Use this class to get a reference to the [Fields](/apps-script/reference/data-studio/fields)\nobject and the [FieldType](/apps-script/reference/data-studio/field-type) and [AggregationType](/apps-script/reference/data-studio/aggregation-type) enums so they can be used in the\nconstruction of [Field](/apps-script/reference/data-studio/field)s.\n\n```javascript\nconst cc = DataStudioApp.createCommunityConnector();\n\nconst fields = cc.getFields();\n\nfields.newMetric()\n .setAggregation(cc.AggregationType.AVG)\n .setType(cc.FieldType.CURRENCY_USD);\n``` \n\nProperties\n\n| Property | Type | Description |\n|-------------------------------|--------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|\n| `Aggregation``Type` | [AggregationType](/apps-script/reference/data-studio/aggregation-type) | The [AggregationType](/apps-script/reference/data-studio/aggregation-type) enumeration. |\n| `Auth``Type` | [AuthType](/apps-script/reference/data-studio/auth-type) | The [AuthType](/apps-script/reference/data-studio/auth-type) enumeration. |\n| `Big``Query``Parameter``Type` | [BigQueryParameterType](/apps-script/reference/data-studio/big-query-parameter-type) | The [BigQueryParameterType](/apps-script/reference/data-studio/big-query-parameter-type) enumeration. |\n| `Field``Type` | [FieldType](/apps-script/reference/data-studio/field-type) | The [FieldType](/apps-script/reference/data-studio/field-type) enumeration. |\n\nMethods\n\n| Method | Return type | Brief description |\n|-------------------------------------------------------------|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|\n| [getConfig()](#getConfig()) | [Config](/apps-script/reference/data-studio/config) | Returns a [Config](/apps-script/reference/data-studio/config) object. |\n| [getFields()](#getFields()) | [Fields](/apps-script/reference/data-studio/fields) | Returns a [Fields](/apps-script/reference/data-studio/fields) object. |\n| [newAuthTypeResponse()](#newAuthTypeResponse()) | [GetAuthTypeResponse](/apps-script/reference/data-studio/get-auth-type-response) | Returns a new [GetAuthTypeResponse](/apps-script/reference/data-studio/get-auth-type-response) object. |\n| [newBigQueryConfig()](#newBigQueryConfig()) | [BigQueryConfig](/apps-script/reference/data-studio/big-query-config) | Returns a new [BigQueryConfig](/apps-script/reference/data-studio/big-query-config) object. |\n| [newDebugError()](#newDebugError()) | [DebugError](/apps-script/reference/data-studio/debug-error) | Returns a new [DebugError](/apps-script/reference/data-studio/debug-error) object. |\n| [newGetDataResponse()](#newGetDataResponse()) | [GetDataResponse](/apps-script/reference/data-studio/get-data-response) | Returns a new [GetDataResponse](/apps-script/reference/data-studio/get-data-response) object. |\n| [newGetSchemaResponse()](#newGetSchemaResponse()) | [GetSchemaResponse](/apps-script/reference/data-studio/get-schema-response) | Returns a new [GetSchemaResponse](/apps-script/reference/data-studio/get-schema-response) object. |\n| [newSetCredentialsResponse()](#newSetCredentialsResponse()) | [SetCredentialsResponse](/apps-script/reference/data-studio/set-credentials-response) | Returns a new [SetCredentialsResponse](/apps-script/reference/data-studio/set-credentials-response) object. |\n| [newUserError()](#newUserError()) | [UserError](/apps-script/reference/data-studio/user-error) | Returns a new [UserError](/apps-script/reference/data-studio/user-error) object. |\n\nDetailed documentation \n\n`get``Config()` \nReturns a [Config](/apps-script/reference/data-studio/config) object. Use this object to add configuration entries.\n\nReturn\n\n\n[Config](/apps-script/reference/data-studio/config) --- A [Config](/apps-script/reference/data-studio/config) object.\n\n*** ** * ** ***\n\n`get``Fields()` \nReturns a [Fields](/apps-script/reference/data-studio/fields) object. Use this object to add metric and dimension [Field](/apps-script/reference/data-studio/field)s.\n\nReturn\n\n\n[Fields](/apps-script/reference/data-studio/fields) --- A [Fields](/apps-script/reference/data-studio/fields) object.\n\n*** ** * ** ***\n\n`new``Auth``Type``Response()` \nReturns a new [GetAuthTypeResponse](/apps-script/reference/data-studio/get-auth-type-response) object. Use this object to create a response for the\n`get``Auth``Type()` function you implement in your script project.\n\nReturn\n\n\n[GetAuthTypeResponse](/apps-script/reference/data-studio/get-auth-type-response) --- A new [GetAuthTypeResponse](/apps-script/reference/data-studio/get-auth-type-response) object.\n\n*** ** * ** ***\n\n`new``Big``Query``Config()` \nReturns a new [BigQueryConfig](/apps-script/reference/data-studio/big-query-config) object. Use this object to create a response for the\n`get``Data()` function you implement in your script project.\n\nReturn\n\n\n[BigQueryConfig](/apps-script/reference/data-studio/big-query-config) --- A new [BigQueryConfig](/apps-script/reference/data-studio/big-query-config) object.\n\n*** ** * ** ***\n\n`new``Debug``Error()` \nReturns a new [DebugError](/apps-script/reference/data-studio/debug-error) object. Use this object to create debug errors.\n\nReturn\n\n\n[DebugError](/apps-script/reference/data-studio/debug-error) --- A new [DebugError](/apps-script/reference/data-studio/debug-error) object.\n\n*** ** * ** ***\n\n`new``Get``Data``Response()` \nReturns a new [GetDataResponse](/apps-script/reference/data-studio/get-data-response) object. Use this object to create a response for the\n`get``Data()` function you implement in your script project.\n\nReturn\n\n\n[GetDataResponse](/apps-script/reference/data-studio/get-data-response) --- A new [GetDataResponse](/apps-script/reference/data-studio/get-data-response) object.\n\n*** ** * ** ***\n\n`new``Get``Schema``Response()` \nReturns a new [GetSchemaResponse](/apps-script/reference/data-studio/get-schema-response) object. Use this object to create a response for the\n`get``Schema()` function you implement in your script project.\n\nReturn\n\n\n[GetSchemaResponse](/apps-script/reference/data-studio/get-schema-response) --- A new [GetSchemaResponse](/apps-script/reference/data-studio/get-schema-response) object.\n\n*** ** * ** ***\n\n`new``Set``Credentials``Response()` \nReturns a new [SetCredentialsResponse](/apps-script/reference/data-studio/set-credentials-response) object. Use this object to create a response for\nthe `set``Credentials()` function you implement in your script project.\n\nReturn\n\n\n[SetCredentialsResponse](/apps-script/reference/data-studio/set-credentials-response) --- A new [SetCredentialsResponse](/apps-script/reference/data-studio/set-credentials-response) object.\n\n*** ** * ** ***\n\n`new``User``Error()` \nReturns a new [UserError](/apps-script/reference/data-studio/user-error) object. Use this object to create user errors.\n\nReturn\n\n\n[UserError](/apps-script/reference/data-studio/user-error) --- A new [UserError](/apps-script/reference/data-studio/user-error) object."]]