Class PlatformDataSource

แพลตฟอร์มแหล่งข้อมูล

สําหรับวิดเจ็ต SelectionInput ที่ใช้เมนูแบบเลือกหลายรายการ แหล่งข้อมูลจาก 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

เมธอด

วิธีการประเภทการแสดงผลรายละเอียดแบบย่อ
setCommonDataSource(commonDataSource)PlatformDataSourceตั้งค่าแหล่งข้อมูลจาก Google Workspace
setHostAppDataSource(hostAppDataSource)PlatformDataSourceใช้เพื่อป้อนข้อมูลพื้นที่ทำงานในเมนูแบบเลือกหลายรายการ

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

setCommonDataSource(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);
ใช้ได้กับแอป Google Chat เท่านั้น ไม่พร้อมใช้งานสำหรับส่วนเสริมของ Google Workspace

พารามิเตอร์

ชื่อประเภทคำอธิบาย
commonDataSourceCommonDataSourceแหล่งข้อมูลที่จะตั้งค่า

รีเทิร์น

PlatformDataSource — ออบเจ็กต์นี้สําหรับการต่อเชื่อม


setHostAppDataSource(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);
ใช้ได้กับแอป Google Chat เท่านั้น ไม่พร้อมใช้งานสำหรับส่วนเสริมของ Google Workspace

พารามิเตอร์

ชื่อประเภทคำอธิบาย
hostAppDataSourceHostAppDataSourceแหล่งข้อมูลที่จะตั้งค่า

รีเทิร์น

PlatformDataSource — ออบเจ็กต์นี้สําหรับการต่อเชื่อม