Per un widget Selection che utilizza un menu a selezione multipla, un'origine dati di Google
Workspace. Utilizzato per compilare gli elementi in un menu a selezione multipla.
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);
Disponibile solo per le app Google Chat. Non disponibile per i componenti aggiuntivi di Google Workspace.
Metodi
| Metodo | Tipo restituito | Breve descrizione |
|---|---|---|
set | Platform | Imposta l'origine dati da Google Workspace. |
set | Platform | Imposta la specifica dell'origine dati di Drive da Google Workspace. |
set | Platform | Utilizzato per compilare gli spazi nel menu di selezione multipla. |
Documentazione dettagliata
set Common Data Source(commonDataSource)
Imposta l'origine dati da 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);
Parametri
| Nome | Tipo | Descrizione |
|---|---|---|
common | Common | L'origine dati da impostare. |
Indietro
Platform: questo oggetto, per il concatenamento.
set Drive Data Source Spec(driveDataSourceSpec)
Imposta la specifica dell'origine dati di Drive da 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) al manifest.Parametri
| Nome | Tipo | Descrizione |
|---|---|---|
drive | Drive | La specifica dell'origine dati di Drive da impostare. |
Indietro
Platform: questo oggetto, per il concatenamento.
set Host App Data Source(hostAppDataSource)
Utilizzato per compilare gli spazi nel menu di selezione multipla.
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);
Parametri
| Nome | Tipo | Descrizione |
|---|---|---|
host | Host | L'origine dati da impostare. |
Indietro
Platform: questo oggetto, per il concatenamento.