Class CommunityConnector
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Conectoresda comunidade
O conectorda comunidade permite que scripts acessem builders e utilitários para ajudar no desenvolvimento de conectores da comunidade para o Data Studio. Use essa classe para receber uma referência ao objeto Fields
e aos tipos enumerados FieldType
e AggregationType
para que eles possam ser usados na
construção de Field
s.
const cc = DataStudioApp.createCommunityConnector();
const fields = cc.getFields();
fields.newMetric()
.setAggregation(cc.AggregationType.AVG)
.setType(cc.FieldType.CURRENCY_USD);
Documentação detalhada
getConfig()
Retorna um objeto Config
. Use esse objeto para adicionar entradas de configuração.
Retornar
Config
: um objeto Config
.
getFields()
Retorna um objeto Fields
. Use esse objeto para adicionar Field
s de métrica e dimensão.
Retornar
Fields
: um objeto Fields
.
newSetCredentialsResponse()
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-07-26 UTC.
[null,null,["Última atualização 2025-07-26 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,["# Class CommunityConnector\n\nCommunityConnector\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\n### Properties\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\n### Methods\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\n### `get``Config()`\n\nReturns a [Config](/apps-script/reference/data-studio/config) object. Use this object to add configuration entries.\n\n#### Return\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()`\n\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\n#### Return\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()`\n\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\n#### Return\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()`\n\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\n#### Return\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()`\n\nReturns a new [DebugError](/apps-script/reference/data-studio/debug-error) object. Use this object to create debug errors.\n\n#### Return\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()`\n\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\n#### Return\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()`\n\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\n#### Return\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()`\n\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\n#### Return\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()`\n\nReturns a new [UserError](/apps-script/reference/data-studio/user-error) object. Use this object to create user errors.\n\n#### Return\n\n\n[UserError](/apps-script/reference/data-studio/user-error) --- A new [UserError](/apps-script/reference/data-studio/user-error) object."]]