تنظيم صفحاتك في مجموعات يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
النظامالمشغّللمصدر
بالنسبة إلى تطبيق مصغّر SelectionInput يستخدم قائمة اختيار متعدّد، يجب أن يكون مصدر البيانات من Google Workspace. تُستخدَم لتعبئة العناصر في قائمة اختيار متعدّد.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003e\u003ccode\u003ePlatformDataSource\u003c/code\u003e is used to populate items in a multiselect menu for a \u003ccode\u003eSelectionInput\u003c/code\u003e widget within Google Chat apps.\u003c/p\u003e\n"],["\u003cp\u003eIt allows developers to set data sources from Google Workspace using \u003ccode\u003esetCommonDataSource\u003c/code\u003e such as Users.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can also use \u003ccode\u003esetHostAppDataSource\u003c/code\u003e to populate spaces in the multiselect menu.\u003c/p\u003e\n"],["\u003cp\u003eThis functionality is exclusive to Google Chat apps and is not available for Google Workspace Add-ons.\u003c/p\u003e\n"]]],[],null,["# Class PlatformDataSource\n\nPlatformDataSource\n\nFor a [SelectionInput](/apps-script/reference/card-service/selection-input) widget that uses a multiselect menu, a data source from Google\nWorkspace. Used to populate items in a multiselect menu.\n\n```javascript\nconst platformDataSource =\n CardService.newPlatformDataSource().setCommonDataSource(\n CardService.CommonDataSource.USER,\n );\n\nconst multiSelect = CardService.newSelectionInput()\n .setType(CardService.SelectionInputType.MULTI_SELECT)\n .setFieldName('contacts')\n .setTitle('Selected contacts')\n .setMultiSelectMaxSelectedItems(5)\n .setMultiSelectMinQueryLength(1)\n .setPlatformDataSource(platformDataSource);\n```\n\nOnly available for Google Chat apps. Not available for Google Workspace add-ons. \n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------------------------------------------------------------------|-------------------------|----------------------------------------------|\n| [setCommonDataSource(commonDataSource)](#setCommonDataSource(CommonDataSource)) | [PlatformDataSource](#) | Sets the data source from Google Workspace. |\n| [setHostAppDataSource(hostAppDataSource)](#setHostAppDataSource(HostAppDataSource)) | [PlatformDataSource](#) | Used to populate spaces in multiselect menu. |\n\nDetailed documentation\n----------------------\n\n### `set``Common``Data``Source(commonDataSource)`\n\nSets the data source from Google Workspace.\n\n```javascript\nconst platformDataSource =\n CardService.newPlatformDataSource().setCommonDataSource(\n CardService.CommonDataSource.USER,\n );\n\nconst multiSelect = CardService.newSelectionInput()\n .setType(CardService.SelectionInputType.MULTI_SELECT)\n .setFieldName('contacts')\n .setTitle('Selected contacts')\n .setMultiSelectMaxSelectedItems(5)\n .setMultiSelectMinQueryLength(1)\n .setPlatformDataSource(platformDataSource);\n```\nOnly available for Google Chat apps. Not available for Google Workspace add-ons.\n\n#### Parameters\n\n| Name | Type | Description |\n|------------------------|----------------------------------------------------------------------------|----------------------------|\n| `common``Data``Source` | [CommonDataSource](/apps-script/reference/card-service/common-data-source) | The data source to be set. |\n\n#### Return\n\n\n[PlatformDataSource](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Host``App``Data``Source(hostAppDataSource)`\n\nUsed to populate spaces in multiselect menu.\n\n```javascript\nconst chatSpaceDataSource =\n CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);\n\nconst chatClientDataSource =\n CardService.newChatClientDataSource().setSpaceDataSource(\n chatSpaceDataSource);\n\nconst hostAppDataSource =\n CardService.newHostAppDataSource().setChatDataSource(chatClientDataSource);\n\nconst platformDataSource =\n CardService.newPlatformDataSource().setHostAppDataSource(hostAppDataSource);\n\nconst multiSelect = CardService.newSelectionInput()\n .setType(CardService.SelectionInputType.MULTI_SELECT)\n .setFieldName('contacts')\n .setTitle('Selected contacts')\n .setMultiSelectMaxSelectedItems(5)\n .setMultiSelectMinQueryLength(1)\n .setPlatformDataSource(platformDataSource);\n```\nOnly available for Google Chat apps. Not available for Google Workspace add-ons.\n\n#### Parameters\n\n| Name | Type | Description |\n|---------------------------|-------------------------------------------------------------------------------|----------------------------|\n| `host``App``Data``Source` | [HostAppDataSource](/apps-script/reference/card-service/host-app-data-source) | The data source to be set. |\n\n#### Return\n\n\n[PlatformDataSource](#) --- This object, for chaining."]]