Class CommunityConnector
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
CommunityConnector
CommunityConnector מאפשר לסקריפטים לגשת ל-builders ולכלי עזר כדי לעזור בפיתוח של מחברי קהילה ל-Data Studio. משתמשים בכיתה הזו כדי לקבל הפניה לאובייקט Fields
ולממשקי ה-enum FieldType
ו-AggregationType
, כדי שאפשר יהיה להשתמש בהם ביצירת Field
.
const cc = DataStudioApp.createCommunityConnector();
const fields = cc.getFields();
fields.newMetric()
.setAggregation(cc.AggregationType.AVG)
.setType(cc.FieldType.CURRENCY_USD);
מסמכים מפורטים
getConfig()
הפונקציה מחזירה אובייקט Config
. משתמשים באובייקט הזה כדי להוסיף רשומות תצורה.
חזרה
Config
– אובייקט Config
.
getFields()
הפונקציה מחזירה אובייקט Fields
. משתמשים באובייקט הזה כדי להוסיף Field
של מדדים ומאפיינים.
חזרה
Fields
– אובייקט Fields
.
newSetCredentialsResponse()
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 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."]]