[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-30 UTC."],[[["\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,["PlatformDataSource\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\nMethods\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`set``Common``Data``Source(commonDataSource)` \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\nParameters\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\nReturn\n\n\n[PlatformDataSource](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n`set``Host``App``Data``Source(hostAppDataSource)` \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\nParameters\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\nReturn\n\n\n[PlatformDataSource](#) --- This object, for chaining."]]