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.
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
Name | Type | Description |
defaultToCurrentSpace | Boolean | The boolean to be set. |
Return
ChatSpaceDataSource
— 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.
[null,null,["Last updated 2025-01-30 UTC."],[[["ChatSpaceDataSource populates Google Chat spaces as selection items in a multiselect menu, limited to spaces the user has joined."],["It's exclusively for Google Chat apps and unavailable for Google Workspace Add-ons."],["This data source can be configured to default to the current Chat space as a selected item in the menu."]]],["`ChatSpaceDataSource` populates a multiselect menu with Google Chat spaces the user belongs to. `setDefaultToCurrentSpace(true)` sets the current Chat space as the default selection in the menu. This functionality is exclusively for Google Chat apps, not Google Workspace add-ons. The `setDefaultToCurrentSpace` method takes a boolean as input and returns the `ChatSpaceDataSource` object. `newChatSpaceDataSource()` is used to create the object.\n"]]