Class ChatClientDataSource
ChatClientDataSource
W przypadku widżetu SelectionInput
, który korzysta z menu wielokrotnego wyboru, źródło danych z Google Chat.
Źródło danych wypełnia elementy wyboru w menu wielokrotnego wyboru. Użytkownik może na przykład wybrać pokoje Google Chat, do których należy.
const chatSpaceDataSource =
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
const chatClientDataSource =
CardService.newChatClientDataSource().setSpaceDataSource(
chatSpaceDataSource);
Dostępne tylko w przypadku aplikacji Google Chat. Niedostępne w przypadku dodatków Google Workspace.
Szczegółowa dokumentacja
setSpaceDataSource(spaceDataSource)
Źródło danych, które wypełnia pokoje Google Chat jako elementy do wyboru w menu wyboru wielokrotnego. Wypełnia tylko pokoje, w których użytkownik jest członkiem.
const chatSpaceDataSource =
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
const chatClientDataSource =
CardService.newChatClientDataSource().setSpaceDataSource(
chatSpaceDataSource);
Dostępne tylko w przypadku aplikacji Google Chat. Niedostępne w przypadku dodatków Google Workspace.
Parametry
Powrót
ChatClientDataSource
– ten obiekt do łańcucha.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-01-30 UTC.
[null,null,["Ostatnia aktualizacja: 2025-01-30 UTC."],[[["`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` is a data source for multiselect menus in Google Chat apps. It populates selection items with Google Chat spaces a user belongs to. The `setSpaceDataSource` method configures this behavior, taking a `ChatSpaceDataSource` as input. Using `CardService.newChatClientDataSource()` allows the setting up the data source and `CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true)` allows the default current space. The data is only available for Google Chat apps, not Google Workspace add-ons.\n"]]