Class ChatClientDataSource

  • ChatClientDataSource is a data source for a multiselect menu in a SelectionInput widget, specifically for Google Chat.

  • It populates selection items, for example, Google Chat spaces the user is a member of.

  • This feature is exclusively available for Google Chat apps and not for Google Workspace add-ons.

  • The setSpaceDataSource method populates Google Chat spaces as selection items for a multiselect menu.

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.

constchatSpaceDataSource=
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
constchatClientDataSource=
CardService.newChatClientDataSource().setSpaceDataSource(
chatSpaceDataSource);

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

Methods

MethodReturn typeBrief description
setSpaceDataSource(spaceDataSource) ChatClientDataSource A 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.

constchatSpaceDataSource=
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
constchatClientDataSource=
CardService.newChatClientDataSource().setSpaceDataSource(
chatSpaceDataSource);
Only available for Google Chat apps. Not available for Google Workspace add-ons.

Parameters

NameTypeDescription
spaceDataSourceChatSpaceDataSource The data source to be set.

Return

ChatClientDataSource — This object, for chaining.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年01月30日 UTC.