Class CommunityConnector

CommunityConnector

CommunityConnector ช่วยให้สคริปต์เข้าถึงเครื่องมือสร้างและยูทิลิตีเพื่อช่วยในการพัฒนา ปลั๊กอินจากชุมชนสำหรับ 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);

พร็อพเพอร์ตี้

พร็อพเพอร์ตี้ประเภทคำอธิบาย
AggregationTypeAggregationTypeAggregationTypeการแจงนับ
AuthTypeAuthTypeAuthTypeการแจงนับ
BigQueryParameterTypeBigQueryParameterTypeBigQueryParameterTypeการแจงนับ
FieldTypeFieldTypeFieldTypeการแจงนับ

เมธอด

วิธีการประเภทการแสดงผลรายละเอียดแบบย่อ
getConfig()Configแสดงผลออบเจ็กต์ Config
getFields()Fieldsแสดงผลออบเจ็กต์ Fields
newAuthTypeResponse()GetAuthTypeResponseแสดงผลออบเจ็กต์ GetAuthTypeResponse ใหม่
newBigQueryConfig()BigQueryConfigแสดงผลออบเจ็กต์ BigQueryConfig ใหม่
newDebugError()DebugErrorแสดงผลออบเจ็กต์ DebugError ใหม่
newGetDataResponse()GetDataResponseแสดงผลออบเจ็กต์ GetDataResponse ใหม่
newGetSchemaResponse()GetSchemaResponseแสดงผลออบเจ็กต์ GetSchemaResponse ใหม่
newSetCredentialsResponse()SetCredentialsResponseแสดงผลออบเจ็กต์ SetCredentialsResponse ใหม่
newUserError()UserErrorแสดงผลออบเจ็กต์ UserError ใหม่

เอกสารโดยละเอียด

getConfig()

แสดงผลออบเจ็กต์ Config ใช้ออบเจ็กต์นี้เพื่อเพิ่มรายการการกำหนดค่า

รีเทิร์น

Config — ออบเจ็กต์ Config


getFields()

แสดงผลออบเจ็กต์ Fields ใช้ออบเจ็กต์นี้เพื่อเพิ่มเมตริกและมิติข้อมูล Fields

รีเทิร์น

Fields — ออบเจ็กต์ Fields


newAuthTypeResponse()

แสดงผลออบเจ็กต์ GetAuthTypeResponse ใหม่ ใช้ออบเจ็กต์นี้เพื่อสร้างการตอบกลับสำหรับฟังก์ชัน getAuthType() ที่คุณใช้ในโปรเจ็กต์สคริปต์

รีเทิร์น

GetAuthTypeResponse — ออบเจ็กต์ GetAuthTypeResponse ใหม่


newBigQueryConfig()

แสดงผลออบเจ็กต์ BigQueryConfig ใหม่ ใช้ออบเจ็กต์นี้เพื่อสร้างการตอบกลับสำหรับฟังก์ชัน getData() ที่คุณใช้ในโปรเจ็กต์สคริปต์

รีเทิร์น

BigQueryConfig — ออบเจ็กต์ BigQueryConfig ใหม่


newDebugError()

แสดงผลออบเจ็กต์ DebugError ใหม่ ใช้ออบเจ็กต์นี้เพื่อสร้างข้อผิดพลาดในการแก้ไขข้อบกพร่อง

รีเทิร์น

DebugError — ออบเจ็กต์ DebugError ใหม่


newGetDataResponse()

แสดงผลออบเจ็กต์ GetDataResponse ใหม่ ใช้ออบเจ็กต์นี้เพื่อสร้างการตอบกลับสำหรับฟังก์ชัน getData() ที่คุณใช้ในโปรเจ็กต์สคริปต์

รีเทิร์น

GetDataResponse — ออบเจ็กต์ GetDataResponse ใหม่


newGetSchemaResponse()

แสดงผลออบเจ็กต์ GetSchemaResponse ใหม่ ใช้ออบเจ็กต์นี้เพื่อสร้างการตอบกลับสำหรับฟังก์ชัน getSchema() ที่คุณใช้ในโปรเจ็กต์สคริปต์

รีเทิร์น

GetSchemaResponse — ออบเจ็กต์ GetSchemaResponse ใหม่


newSetCredentialsResponse()

แสดงผลออบเจ็กต์ SetCredentialsResponse ใหม่ ใช้ออบเจ็กต์นี้เพื่อสร้างการตอบกลับสำหรับฟังก์ชัน setCredentials() ที่คุณใช้ในโปรเจ็กต์สคริปต์

รีเทิร์น

SetCredentialsResponse — ออบเจ็กต์ SetCredentialsResponse ใหม่


newUserError()

แสดงผลออบเจ็กต์ UserError ใหม่ ใช้ออบเจ็กต์นี้เพื่อสร้างข้อผิดพลาดของผู้ใช้

รีเทิร์น

UserError — ออบเจ็กต์ UserError ใหม่