สําหรับวิดเจ็ต 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 | ใช้เพื่อป้อนข้อมูลพื้นที่ทำงานในเมนูแบบเลือกหลายรายการ | 
เอกสารประกอบโดยละเอียด
set
ตั้งค่าแหล่งข้อมูลจาก 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
ใช้เพื่อป้อนข้อมูลพื้นที่ทำงานในเมนูแบบเลือกหลายรายการ
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 — ออบเจ็กต์นี้สําหรับการต่อเชื่อม