Class PlatformDataSource

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)PlatformDataSourceGoogle Workspace からデータソースを設定します。
setDriveDataSourceSpec(driveDataSourceSpec)PlatformDataSourceGoogle 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 - チェーン用のこのオブジェクト。


setDriveDataSourceSpec(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);
Google Chat アプリで利用できます。Google Workspace アドオンの場合、マニフェストにファイルごとのアクセス スコープhttps://www.googleapis.com/auth/drive.file)を追加する必要があります。

パラメータ

名前説明
driveDataSourceSpecDriveDataSourceSpec設定するドライブ データソースの仕様。

戻る

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 - チェーン用のこのオブジェクト。