Class CommunityConnector

  • The CommunityConnector class enables scripts to access builders and utilities for developing Community Connectors for Data Studio.

  • It provides access to Fields, FieldType, and AggregationType for constructing Field objects within your connector.

  • CommunityConnector offers methods to manage configurations, define data schemas, handle authentication, and create response objects for various connector functions.

  • It also allows the creation of user and debug errors for better error handling within your connector.

  • Developers can utilize methods like getConfig(), getFields(), and response builders such as newGetDataResponse() to interact with and control the connector's behavior.

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.

const cc = DataStudioApp.createCommunityConnector();

const fields = cc.getFields();

fields.newMetric()
    .setAggregation(cc.AggregationType.AVG)
    .setType(cc.FieldType.CURRENCY_USD);

Properties

PropertyTypeDescription
AggregationTypeAggregationTypeThe AggregationType enumeration.
AuthTypeAuthTypeThe AuthType enumeration.
BigQueryParameterTypeBigQueryParameterTypeThe BigQueryParameterType enumeration.
FieldTypeFieldTypeThe FieldType enumeration.

Methods

MethodReturn typeBrief description
getConfig()ConfigReturns a Config object.
getFields()FieldsReturns a Fields object.
newAuthTypeResponse()GetAuthTypeResponseReturns a new GetAuthTypeResponse object.
newBigQueryConfig()BigQueryConfigReturns a new BigQueryConfig object.
newDebugError()DebugErrorReturns a new DebugError object.
newGetDataResponse()GetDataResponseReturns a new GetDataResponse object.
newGetSchemaResponse()GetSchemaResponseReturns a new GetSchemaResponse object.
newSetCredentialsResponse()SetCredentialsResponseReturns a new SetCredentialsResponse object.
newUserError()UserErrorReturns a new UserError object.

Detailed documentation

getConfig()

Returns a Config object. Use this object to add configuration entries.

Return

Config — A Config object.


getFields()

Returns a Fields object. Use this object to add metric and dimension Fields.

Return

Fields — A Fields object.


newAuthTypeResponse()

Returns a new GetAuthTypeResponse object. Use this object to create a response for the getAuthType() function you implement in your script project.

Return

GetAuthTypeResponse — A new GetAuthTypeResponse object.


newBigQueryConfig()

Returns a new BigQueryConfig object. Use this object to create a response for the getData() function you implement in your script project.

Return

BigQueryConfig — A new BigQueryConfig object.


newDebugError()

Returns a new DebugError object. Use this object to create debug errors.

Return

DebugError — A new DebugError object.


newGetDataResponse()

Returns a new GetDataResponse object. Use this object to create a response for the getData() function you implement in your script project.

Return

GetDataResponse — A new GetDataResponse object.


newGetSchemaResponse()

Returns a new GetSchemaResponse object. Use this object to create a response for the getSchema() function you implement in your script project.

Return

GetSchemaResponse — A new GetSchemaResponse object.


newSetCredentialsResponse()

Returns a new SetCredentialsResponse object. Use this object to create a response for the setCredentials() function you implement in your script project.

Return

SetCredentialsResponse — A new SetCredentialsResponse object.


newUserError()

Returns a new UserError object. Use this object to create user errors.

Return

UserError — A new UserError object.