Class ChatClientDataSource

  • ChatClientDataSource is used for multiselect menus in Google Chat apps, allowing users to select items like Google Chat spaces they are members of.

  • This data source relies on a ChatSpaceDataSource to populate the selectable spaces in the menu.

  • It is exclusively available for Google Chat apps and cannot be utilized in Google Workspace Add-ons.

  • The setSpaceDataSource method configures the data source for populating Google Chat spaces in the selection menu, limited to spaces where the user is a member.

ChatClientDataSource

For a SelectionInput widget that uses a multiselect menu, a data source from Google Chat. The data source populates selection items for the multiselect menu. For example, a user can select Google Chat spaces that they're a member of.

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

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

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

Methods

MethodReturn typeBrief description
setSpaceDataSource(spaceDataSource)ChatClientDataSourceA data source that populates Google Chat spaces as selection items for a multiselect menu.

Detailed documentation

setSpaceDataSource(spaceDataSource)

A data source that populates Google Chat spaces as selection items for a multiselect menu. Only populates spaces that the user is a member of.

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

const chatClientDataSource =
    CardService.newChatClientDataSource().setSpaceDataSource(
        chatSpaceDataSource);
Only available for Google Chat apps. Not available for Google Workspace add-ons.

Parameters

NameTypeDescription
spaceDataSourceChatSpaceDataSourceThe data source to be set.

Return

ChatClientDataSource — This object, for chaining.