Class HostAppDataSource

HostAppDataSource

For a SelectionInput widget that uses a multiselect menu, a data source from a Google Workspace application. The data source populates selection items for the multiselect menu.

const chatSpaceDataSource =
    CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);

const chatClientDataSource =
    CardService.newChatClientDataSource().setSpaceDataSource(
        chatSpaceDataSource);

const hostAppDataSource =
    CardService.newHostAppDataSource().setChatDataSource(chatClientDataSource);

Only available for Google Chat apps. Not available for Google Workspace Add-ons.

Methods

MethodReturn typeBrief description
setChatDataSource(chatClientDataSource)HostAppDataSourceSets the data source from Google Chat.

Detailed documentation

setChatDataSource(chatClientDataSource)

Sets the data source from Google Chat.

const chatSpaceDataSource =
    CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);

const chatClientDataSource =
    CardService.newChatClientDataSource().setSpaceDataSource(
        chatSpaceDataSource);

const hostAppDataSource =
    CardService.newHostAppDataSource().setChatDataSource(chatClientDataSource);
Only available for Google Chat apps. Not available for Google Workspace Add-ons.

Parameters

NameTypeDescription
chatClientDataSourceChatClientDataSourceThe data source to be set.

Return

HostAppDataSource — This object, for chaining.