Class HostAppDataSource

  • HostAppDataSource is used with SelectionInput widgets in multiselect menus to populate items from a Google Workspace application data source.

  • This feature is exclusively available for Google Chat apps and cannot be used with Google Workspace add-ons.

  • ThesetChatDataSource method allows setting the data source from Google Chat.

HostAppDataSource

For aSelectionInput widget that uses a multiselect menu, a data source from a GoogleWorkspace application. The data source populates selection items for the multiselect menu.

constchatSpaceDataSource=CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);constchatClientDataSource=CardService.newChatClientDataSource().setSpaceDataSource(chatSpaceDataSource);consthostAppDataSource=CardService.newHostAppDataSource().setChatDataSource(chatClientDataSource);

Only available for Google Chat apps and Google Workspace add-ons that extend flows. Notavailable for other Google Workspace add-ons.

Methods

MethodReturn typeBrief description
setChatDataSource(chatClientDataSource)HostAppDataSourceSets the data source from Google Chat.
setWorkflowDataSource(workflowDataSource)HostAppDataSourceSets the data source from Google Workspace Flows.

Detailed documentation

setChatDataSource(chatClientDataSource)

Sets the data source from Google Chat.

constchatSpaceDataSource=CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);constchatClientDataSource=CardService.newChatClientDataSource().setSpaceDataSource(chatSpaceDataSource);consthostAppDataSource=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.


setWorkflowDataSource(workflowDataSource)

Sets the data source from Google Workspace Flows.

Only available for Google Workspace add-ons that extend Google Workspace Studio.

constworkflowDataSource=CardService.newWorkflowDataSource().setIncludeVariables(true);consthostAppDataSource=CardService.newHostAppDataSource().setWorkflowDataSource(workflowDataSource);

Parameters

NameTypeDescription
workflowDataSourceWorkflowDataSourceThe data source to be set.

Return

HostAppDataSource — This object, for chaining.

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

Last updated 2025-12-03 UTC.