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 アドオンでは利用できません。

Methods

メソッド戻り値の型概要
setCommonDataSource(commonDataSource)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 - チェーン用のこのオブジェクト。


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