Class HostAppDataSource
المضيفالتطبيقمصدرالبيانات
بالنسبة إلى تطبيق مصغّر SelectionInput
يستخدم قائمة اختيار متعدّد، يجب توفير مصدر بيانات من تطبيق
Workspace. يعبّئ مصدر البيانات عناصر الاختيار لقائمة الاختيار المتعدّد.
const chatSpaceDataSource =
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
const chatClientDataSource =
CardService.newChatClientDataSource().setSpaceDataSource(
chatSpaceDataSource);
const hostAppDataSource =
CardService.newHostAppDataSource().setChatDataSource(chatClientDataSource);
لا تتوفّر هذه الميزة إلا لتطبيقات Google Chat. لا تتوفّر الإضافات في Google Workspace.
مستندات تفصيلية
setChatDataSource(chatClientDataSource)
لضبط مصدر البيانات من Google Chat
const chatSpaceDataSource =
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
const chatClientDataSource =
CardService.newChatClientDataSource().setSpaceDataSource(
chatSpaceDataSource);
const hostAppDataSource =
CardService.newHostAppDataSource().setChatDataSource(chatClientDataSource);
هذه الميزة متاحة فقط لتطبيقات Google Chat. لا تتوفّر الإضافات في Google Workspace.
المعلمات
الإرجاع
HostAppDataSource
: هذا العنصر، لإنشاء سلسلة.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-01-30 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-01-30 (حسب التوقيت العالمي المتفَّق عليه)"],[[["`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"]]