לווידג'ט 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.
Methods
| שיטה | סוג הערך שמוחזר | תיאור קצר |
|---|---|---|
set | Platform | הגדרת מקור הנתונים מ-Google Workspace. |
set | Platform | הגדרת מפרט מקור הנתונים של Drive מ-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)
הגדרת מפרט מקור הנתונים של Drive מ-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) למניפסט.פרמטרים
| שם | סוג | תיאור |
|---|---|---|
drive | 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 – האובייקט הזה, לשרשור.