Class HostAppDataSource
Máy chủ lưu trữỨng dụngNguồndữ liệu
Đối với tiện ích SelectionInput
sử dụng trình đơn nhiều lựa chọn, nguồn dữ liệu từ một ứng dụng Google Workspace. Nguồn dữ liệu sẽ điền các mục lựa chọn cho trình đơn đa lựa chọn.
const chatSpaceDataSource =
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
const chatClientDataSource =
CardService.newChatClientDataSource().setSpaceDataSource(
chatSpaceDataSource);
const hostAppDataSource =
CardService.newHostAppDataSource().setChatDataSource(chatClientDataSource);
Chỉ dành cho ứng dụng Google Chat. Không dùng được cho các tiện ích bổ sung của Google Workspace.
Tài liệu chi tiết
setChatDataSource(chatClientDataSource)
Đặt nguồn dữ liệu từ Google Chat.
const chatSpaceDataSource =
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
const chatClientDataSource =
CardService.newChatClientDataSource().setSpaceDataSource(
chatSpaceDataSource);
const hostAppDataSource =
CardService.newHostAppDataSource().setChatDataSource(chatClientDataSource);
Chỉ dành cho ứng dụng Google Chat. Không dùng được cho các tiện ích bổ sung của Google Workspace.
Thông số
Cầu thủ trả bóng
HostAppDataSource
– Đối tượng này, để tạo chuỗi.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-01-30 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-01-30 UTC."],[[["`HostAppDataSource` is used for populating selection items in a multiselect menu within a Google Chat app."],["It leverages a data source from Google Chat, configured using `ChatClientDataSource` and `ChatSpaceDataSource`."],["This functionality is exclusive to Google Chat apps and is not available for Google Workspace Add-ons."],["The key method is `setChatDataSource()`, used for setting the Google Chat data source."]]],["`HostAppDataSource` provides a data source for multiselect menus in Google Chat apps, using `SelectionInput`. It's created via `CardService.newHostAppDataSource()`. `setChatDataSource()` is used to specify the data source, which must be a `ChatClientDataSource`. In turn, `ChatClientDataSource` is configured with a `ChatSpaceDataSource`. Only available for Chat apps, it sets the data source for populating selection items within the menu, and returns the current `HostAppDataSource` object.\n"]]