Class CommunityConnector

CommunityConnector

CommunityConnector ช่วยให้สคริปต์เข้าถึงเครื่องมือสร้างและยูทิลิตีเพื่อช่วยในการพัฒนาปลั๊กอินจากชุมชนสำหรับใช้ลิงก์ข้อมูลสำหรับ Data Studio ใช้คลาสนี้เพื่อรับการอ้างอิงไปยังออบเจ็กต์ Fields และ Enum FieldType และ AggregationType เพื่อให้นำไปใช้ในการสร้าง Field ได้

var cc = DataStudioApp.createCommunityConnector();
var fieldType = cc.FieldType;
var aggregationType = cc.AggregationType;

var fields = cc.getFields();

fields.newMetric()
  .setAggregation(aggregationType.AVG)
  .setType(fieldType.CURRENCY_USD);

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

พร็อพเพอร์ตี้Typeคำอธิบาย
AggregationTypeAggregationTypeการแจกแจง AggregationType
AuthTypeAuthTypeการแจกแจง AuthType
BigQueryParameterTypeBigQueryParameterTypeการแจกแจง BigQueryParameterType
FieldTypeFieldTypeการแจกแจง FieldType

วิธีการ

วิธีการประเภทการแสดงผลรายละเอียดแบบย่อ
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 ใช้ออบเจ็กต์นี้เพื่อเพิ่มเมตริกและมิติข้อมูล Field

รีเทิร์น

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 ใหม่