Class ChatSpaceDataSource

ChatSpaceDataSource

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);

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

Methods

MethodReturn typeBrief description
setDefaultToCurrentSpace(defaultToCurrentSpace)ChatSpaceDataSourceIf set to true, the multi select menu selects the current Google Chat space as an item by default.

Detailed documentation

setDefaultToCurrentSpace(defaultToCurrentSpace)

If set to true, the multi select menu selects the current Google Chat space as an item by default.

const chatSpaceDataSource =
    CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
Only available for Google Chat apps. Not available for Google Workspace Add-ons.

Parameters

NameTypeDescription
defaultToCurrentSpaceBooleanThe boolean to be set.

Return

ChatSpaceDataSource — This object, for chaining.