Class Config
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การกําหนดค่า
มีรายการการกําหนดค่าสําหรับเครื่องมือเชื่อมต่อ รายการการกําหนดค่าเหล่านี้จะกําหนดคําถามที่จะถามเมื่อเพิ่มตัวเชื่อมต่อใหม่
const cc = DataStudioApp.createCommunityConnector();
const config = cc.getConfig();
const info_entry = config.newInfo().setId('info_id').setHelpText(
'This connector can connect to multiple data endpoints.');
เอกสารประกอบโดยละเอียด
build()
ตรวจสอบออบเจ็กต์นี้และแสดงผลในรูปแบบที่ Data Studio ต้องการ
รีเทิร์น
Object
— ออบเจ็กต์ Config
ที่ตรวจสอบแล้ว
newCheckbox()
แสดงรายการการกําหนดค่าช่องทําเครื่องหมายใหม่
รีเทิร์น
Checkbox
— รายการการกําหนดค่าช่องทําเครื่องหมายใหม่
newInfo()
แสดงรายการการกําหนดค่าข้อมูลใหม่
รีเทิร์น
Info
— รายการการกําหนดค่าข้อมูลใหม่
newOptionBuilder()
แสดงเครื่องมือสร้างตัวเลือกใหม่
รีเทิร์น
OptionBuilder
— ตัวสร้างตัวเลือกแบบใหม่
newSelectMultiple()
แสดงผลรายการการกำหนดค่าแบบเลือกหลายรายการรายการใหม่
รีเทิร์น
SelectMultiple
— รายการการกําหนดค่าแบบเลือกหลายรายการใหม่
newSelectSingle()
แสดงรายการการกําหนดค่ารายการเดียวที่เลือกใหม่
รีเทิร์น
SelectSingle
— รายการการกําหนดค่ารายการเดียวที่เลือกใหม่
newTextArea()
แสดงผลรายการการกําหนดค่าพื้นที่ข้อความใหม่
รีเทิร์น
TextArea
— รายการการกําหนดค่าพื้นที่ข้อความใหม่
newTextInput()
แสดงรายการการกําหนดค่าอินพุตข้อความใหม่
รีเทิร์น
TextInput
— รายการการกำหนดค่าการป้อนข้อความใหม่
printJson()
พิมพ์การแสดง JSON ของออบเจ็กต์นี้ การดำเนินการนี้มีไว้สำหรับการแก้ไขข้อบกพร่องเท่านั้น
รีเทิร์น
String
setDateRangeRequired(dateRangeRequired)
หากเป็น true
ระบบจะระบุช่วงวันที่สําหรับคําขอ getData()
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
dateRangeRequired | Boolean | ควรระบุช่วงวันที่ในคำขอ getData() หรือไม่ |
รีเทิร์น
Config
— ตัวสร้างนี้สําหรับการต่อเชื่อม
setIsSteppedConfig(isSteppedConfig)
หากเป็น true
ระบบจะเรียก getConfig()
อีกครั้งโดยใช้การกำหนดค่าผู้ใช้ปัจจุบัน
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
isSteppedConfig | Boolean | สถานะการกําหนดค่าแบบเป็นขั้นๆ ที่จะตั้งค่า |
รีเทิร์น
Config
— ตัวสร้างนี้สําหรับการต่อเชื่อม
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eThe \u003ccode\u003eConfig\u003c/code\u003e object defines the configuration entries for a connector, determining the questions asked when adding a new connector.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods for creating various configuration entry types like checkboxes, text inputs, and select lists.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild()\u003c/code\u003e method validates the configuration and returns it in the required format for Data Studio.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esetDateRangeRequired()\u003c/code\u003e and \u003ccode\u003esetIsSteppedConfig()\u003c/code\u003e methods control whether a date range is provided to data requests and if the configuration is stepped.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods such as \u003ccode\u003eprintJson()\u003c/code\u003e for debugging purposes.\u003c/p\u003e\n"]]],[],null,["# Class Config\n\nConfig\n\nContains the configuration entries for a connector. These configuration entries define what\nquestions are asked when adding a new connector.\n\n```javascript\nconst cc = DataStudioApp.createCommunityConnector();\nconst config = cc.getConfig();\n\nconst info_entry = config.newInfo().setId('info_id').setHelpText(\n 'This connector can connect to multiple data endpoints.');\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------------------------------------|----------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [build()](#build()) | `Object` | Validates this object and returns it in the format needed by Data Studio. |\n| [newCheckbox()](#newCheckbox()) | [Checkbox](/apps-script/reference/data-studio/checkbox) | Returns a new checkbox configuration entry. |\n| [newInfo()](#newInfo()) | [Info](/apps-script/reference/data-studio/info) | Returns a new info configuration entry. |\n| [newOptionBuilder()](#newOptionBuilder()) | [OptionBuilder](/apps-script/reference/data-studio/option-builder) | Returns a new options builder. |\n| [newSelectMultiple()](#newSelectMultiple()) | [SelectMultiple](/apps-script/reference/data-studio/select-multiple) | Returns a new select multiple configuration entry. |\n| [newSelectSingle()](#newSelectSingle()) | [SelectSingle](/apps-script/reference/data-studio/select-single) | Returns a new select single configuration entry. |\n| [newTextArea()](#newTextArea()) | [TextArea](/apps-script/reference/data-studio/text-area) | Returns a new text area configuration entry. |\n| [newTextInput()](#newTextInput()) | [TextInput](/apps-script/reference/data-studio/text-input) | Returns a new text input configuration entry. |\n| [printJson()](#printJson()) | `String` | Prints the JSON representation of this object. |\n| [setDateRangeRequired(dateRangeRequired)](#setDateRangeRequired(Boolean)) | [Config](#) | If `true`, a date range is provided for getData() requests. |\n| [setIsSteppedConfig(isSteppedConfig)](#setIsSteppedConfig(Boolean)) | [Config](#) | If `true`, `get``Config()` is called again with the current user configuration. |\n\nDetailed documentation\n----------------------\n\n### `build()`\n\nValidates this object and returns it in the format needed by Data Studio.\n\n#### Return\n\n\n`Object` --- The validated [Config](#) object.\n\n*** ** * ** ***\n\n### `new``Checkbox()`\n\nReturns a new checkbox configuration entry.\n\n#### Return\n\n\n[Checkbox](/apps-script/reference/data-studio/checkbox) --- A new checkbox configuration entry.\n\n*** ** * ** ***\n\n### `new``Info()`\n\nReturns a new info configuration entry.\n\n#### Return\n\n\n[Info](/apps-script/reference/data-studio/info) --- A new info configuration entry.\n\n*** ** * ** ***\n\n### `new``Option``Builder()`\n\nReturns a new options builder.\n\n#### Return\n\n\n[OptionBuilder](/apps-script/reference/data-studio/option-builder) --- A new options builder.\n\n*** ** * ** ***\n\n### `new``Select``Multiple()`\n\nReturns a new select multiple configuration entry.\n\n#### Return\n\n\n[SelectMultiple](/apps-script/reference/data-studio/select-multiple) --- A new select multiple configuration entry.\n\n*** ** * ** ***\n\n### `new``Select``Single()`\n\nReturns a new select single configuration entry.\n\n#### Return\n\n\n[SelectSingle](/apps-script/reference/data-studio/select-single) --- A new select single configuration entry.\n\n*** ** * ** ***\n\n### `new``Text``Area()`\n\nReturns a new text area configuration entry.\n\n#### Return\n\n\n[TextArea](/apps-script/reference/data-studio/text-area) --- A new text area configuration entry.\n\n*** ** * ** ***\n\n### `new``Text``Input()`\n\nReturns a new text input configuration entry.\n\n#### Return\n\n\n[TextInput](/apps-script/reference/data-studio/text-input) --- A new text input configuration entry.\n\n*** ** * ** ***\n\n### `print``Json()`\n\nPrints the JSON representation of this object. This is for debugging only.\n\n#### Return\n\n\n`String`\n\n*** ** * ** ***\n\n### `set``Date``Range``Required(dateRangeRequired)`\n\nIf `true`, a date range is provided for getData() requests.\n\n#### Parameters\n\n| Name | Type | Description |\n|-------------------------|-----------|---------------------------------------------------------------------------|\n| `date``Range``Required` | `Boolean` | Whether or not a date range should be provided to `get``Data()` requests. |\n\n#### Return\n\n\n[Config](#) --- This builder, for chaining.\n\n*** ** * ** ***\n\n### `set``Is``Stepped``Config(isSteppedConfig)`\n\nIf `true`, `get``Config()` is called again with the current user configuration.\n\n#### Parameters\n\n| Name | Type | Description |\n|-----------------------|-----------|-----------------------------------|\n| `is``Stepped``Config` | `Boolean` | The stepped config status to set. |\n\n#### Return\n\n\n[Config](#) --- This builder, for chaining."]]