Çoklu seçim menüsü kullanan bir Selection widget'ı için Google Workspace'ten bir veri kaynağı. Çoklu seçim menüsündeki öğeleri doldurmak için kullanılır.
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);
Yalnızca Google Chat uygulamalarında kullanılabilir. Google Workspace eklentileri için kullanılamaz.
Yöntemler
| Yöntem | Dönüş türü | Kısa açıklama |
|---|---|---|
set | Platform | Google Workspace'ten veri kaynağını ayarlar. |
set | Platform | Google Workspace'ten sürücü veri kaynağı spesifikasyonunu ayarlar. |
set | Platform | Çoklu seçim menüsündeki alanları doldurmak için kullanılır. |
Ayrıntılı belgeler
set Common Data Source(commonDataSource)
Google Workspace'ten veri kaynağını ayarlar.
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);
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
common | Common | Ayarlanacak veri kaynağı. |
Return
Platform: Zincirleme için kullanılan bu nesne.
set Drive Data Source Spec(driveDataSourceSpec)
Google Workspace'ten sürücü veri kaynağı spesifikasyonunu ayarlar.
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) eklenmesi gerekir.Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
drive | Drive | Ayarlanacak sürücü veri kaynağı spesifikasyonu. |
Return
Platform: Zincirleme için kullanılan bu nesne.
set Host App Data Source(hostAppDataSource)
Çoklu seçim menüsündeki alanları doldurmak için kullanılır.
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);
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
host | Host | Ayarlanacak veri kaynağı. |
Return
Platform: Zincirleme için kullanılan bu nesne.