สำหรับSelectionวิดเจ็ตที่ใช้เมนูแบบเลือกหลายรายการ แหล่งข้อมูลจาก Google
Workspace ใช้เพื่อป้อนข้อมูลรายการในเมนูแบบเลือกหลายรายการ
const platformDataSource = CardService.newPlatformDataSource().setCommonDataSource( CardService.CommonDataSource.USER, ); const multiSelect = CardService.newSelectionInput() .setType(CardService.SelectionInputType.MULTI_SELECT) .setFieldName('contacts') .setTitle('Selected contacts') .setMultiSelectMaxSelectedItems(5) .setMultiSelectMinQueryLength(1) .setPlatformDataSource(platformDataSource);
ใช้ได้กับแอป Google Chat เท่านั้น ไม่พร้อมใช้งานสำหรับส่วนเสริม Google Workspace
เมธอด
| วิธีการ | ประเภทการแสดงผล | รายละเอียดแบบย่อ |
|---|---|---|
set | Platform | ตั้งค่าแหล่งข้อมูลจาก Google Workspace |
set | Platform | ตั้งค่าข้อกำหนดแหล่งข้อมูลไดรฟ์จาก Google Workspace |
set | Platform | ใช้เพื่อแสดงพื้นที่ทำงานในเมนูแบบหลายรายการ |
เอกสารโดยละเอียด
set Common Data Source(commonDataSource)
ตั้งค่าแหล่งข้อมูลจาก Google Workspace
const platformDataSource = CardService.newPlatformDataSource().setCommonDataSource( CardService.CommonDataSource.USER, ); const multiSelect = CardService.newSelectionInput() .setType(CardService.SelectionInputType.MULTI_SELECT) .setFieldName('contacts') .setTitle('Selected contacts') .setMultiSelectMaxSelectedItems(5) .setMultiSelectMinQueryLength(1) .setPlatformDataSource(platformDataSource);
พารามิเตอร์
| ชื่อ | ประเภท | คำอธิบาย |
|---|---|---|
common | Common | แหล่งข้อมูลที่จะตั้งค่า |
รีเทิร์น
Platform - ออบเจ็กต์นี้สำหรับการเชื่อมโยง
set Drive Data Source Spec(driveDataSourceSpec)
ตั้งค่าข้อกำหนดแหล่งข้อมูลไดรฟ์จาก Google Workspace
const driveDataSourceSpec = CardService.newDriveDataSourceSpec() .addItemType(CardService.DriveItemType.DOCUMENTS) .addItemType(CardService.DriveItemType.FORMS); const platformDataSource = CardService.newPlatformDataSource().setCommonDataSource( CardService.CommonDataSource.DRIVE ).setDriveDataSourceSpec(driveDataSourceSpec); const multiSelect = CardService.newSelectionInput() .setType(CardService.SelectionInputType.MULTI_SELECT) .setFieldName('files') .setTitle('Drive Files') .setMultiSelectMaxSelectedItems(5) .setMultiSelectMinQueryLength(1) .setPlatformDataSource(platformDataSource);
https://www.googleapis.com/auth/drive.file) ลงในไฟล์ Manifestพารามิเตอร์
| ชื่อ | ประเภท | คำอธิบาย |
|---|---|---|
drive | Drive | ระบุแหล่งข้อมูลไดรฟ์ที่จะตั้งค่า |
รีเทิร์น
Platform - ออบเจ็กต์นี้สำหรับการเชื่อมโยง
set Host App Data Source(hostAppDataSource)
ใช้เพื่อแสดงพื้นที่ทำงานในเมนูแบบหลายรายการ
const chatSpaceDataSource = CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true); const chatClientDataSource = CardService.newChatClientDataSource().setSpaceDataSource( chatSpaceDataSource); const hostAppDataSource = CardService.newHostAppDataSource().setChatDataSource(chatClientDataSource); const platformDataSource = CardService.newPlatformDataSource().setHostAppDataSource(hostAppDataSource); const multiSelect = CardService.newSelectionInput() .setType(CardService.SelectionInputType.MULTI_SELECT) .setFieldName('contacts') .setTitle('Selected contacts') .setMultiSelectMaxSelectedItems(5) .setMultiSelectMinQueryLength(1) .setPlatformDataSource(platformDataSource);
พารามิเตอร์
| ชื่อ | ประเภท | คำอธิบาย |
|---|---|---|
host | Host | แหล่งข้อมูลที่จะตั้งค่า |
รีเทิร์น
Platform - ออบเจ็กต์นี้สำหรับการเชื่อมโยง