マルチセレクト メニューを使用する 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 | 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)
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 | 設定するドライブ データソースの仕様。 |
戻る
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 - チェーン用のこのオブジェクト。