Reference documentation and code samples for the Google Apps Chat V1 Client class SelectionInput.
A widget that creates one or more UI items that users can select.
For example, a dropdown menu or checkboxes. You can use this widget to
collect data that can be predicted or enumerated. For an example in Google
Chat apps, seeAdd selectable UI
elements.
Chat apps can process the value of items that users select or input. For
details about working with form inputs, seeReceive form
data.
To collect undefined or abstract data from users, use
theTextInputwidget.Google Workspace Add-ons
and Chat apps:
Generated from protobuf messagegoogle.apps.card.v1.SelectionInput
Namespace
Google \ Apps \ Card \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
The name that identifies the selection input in a form input event. For details about working with form inputs, seeReceive form data.
↳ label
string
The text that appears above the selection input field in the user interface. Specify text that helps the user enter the information your app needs. For example, if users are selecting the urgency of a work ticket from a drop-down menu, the label might be "Urgency" or "Select urgency".
↳ type
int
The type of items that are displayed to users in aSelectionInputwidget. Selection types support different types of interactions. For example, users can select one or more checkboxes, but they can only select one value from a dropdown menu.
If specified, the form is submitted when the selection changes. If not specified, you must specify a separate button that submits the form. For details about working with form inputs, seeReceive form data.
↳ multi_select_max_selected_items
int
For multiselect menus, the maximum number of items that a user can select. Minimum value is 1 item. If unspecified, defaults to 3 items.
↳ multi_select_min_query_length
int
For multiselect menus, the number of text characters that a user inputs before the app queries autocomplete and displays suggested items in the menu. If unspecified, defaults to 0 characters for static data sources and 3 characters for external data sources.
The text that appears above the selection input field in the user
interface.
Specify text that helps the user enter the information your app needs.
For example, if users are selecting the urgency of a work ticket from a
drop-down menu, the label might be "Urgency" or "Select urgency".
Returns
Type
Description
string
setLabel
The text that appears above the selection input field in the user
interface.
Specify text that helps the user enter the information your app needs.
For example, if users are selecting the urgency of a work ticket from a
drop-down menu, the label might be "Urgency" or "Select urgency".
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getType
The type of items that are displayed to users in aSelectionInputwidget.
Selection types support different types of interactions. For example, users
can select one or more checkboxes, but they can only select one value from
a dropdown menu.
Returns
Type
Description
int
setType
The type of items that are displayed to users in aSelectionInputwidget.
Selection types support different types of interactions. For example, users
can select one or more checkboxes, but they can only select one value from
a dropdown menu.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getItems
An array of selectable items. For example, an array of radio buttons or
checkboxes. Supports up to 100 items.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Apps Chat V1 Client - Class SelectionInput (0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/php/docs/reference/apps-chat/latest/Card.V1.SelectionInput)\n- [0.11.2](/php/docs/reference/apps-chat/0.11.2/Card.V1.SelectionInput)\n- [0.10.0](/php/docs/reference/apps-chat/0.10.0/Card.V1.SelectionInput)\n- [0.9.0](/php/docs/reference/apps-chat/0.9.0/Card.V1.SelectionInput)\n- [0.8.1](/php/docs/reference/apps-chat/0.8.1/Card.V1.SelectionInput)\n- [0.7.2](/php/docs/reference/apps-chat/0.7.2/Card.V1.SelectionInput)\n- [0.6.1](/php/docs/reference/apps-chat/0.6.1/Card.V1.SelectionInput)\n- [0.5.0](/php/docs/reference/apps-chat/0.5.0/Card.V1.SelectionInput)\n- [0.4.0](/php/docs/reference/apps-chat/0.4.0/Card.V1.SelectionInput)\n- [0.3.0](/php/docs/reference/apps-chat/0.3.0/Card.V1.SelectionInput)\n- [0.2.0](/php/docs/reference/apps-chat/0.2.0/Card.V1.SelectionInput)\n- [0.1.4](/php/docs/reference/apps-chat/0.1.4/Card.V1.SelectionInput) \nReference documentation and code samples for the Google Apps Chat V1 Client class SelectionInput.\n\nA widget that creates one or more UI items that users can select.\n\nFor example, a dropdown menu or checkboxes. You can use this widget to\ncollect data that can be predicted or enumerated. For an example in Google\nChat apps, see [Add selectable UI\nelements](/workspace/chat/design-interactive-card-dialog#add_selectable_ui_elements).\nChat apps can process the value of items that users select or input. For\ndetails about working with form inputs, see [Receive form\ndata](https://developers.google.com/workspace/chat/read-form-data).\nTo collect undefined or abstract data from users, use\nthe [TextInput](/php/docs/reference/apps-chat/latest/Card.V1.TextInput) widget.\n[Google Workspace Add-ons\nand Chat apps](https://developers.google.com/workspace/extend):\n\nGenerated from protobuf message `google.apps.card.v1.SelectionInput`\n\nNamespace\n---------\n\nGoogle \\\\ Apps \\\\ Card \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nThe name that identifies the selection input in a form input event.\n\nFor details about working with form inputs, see [Receive form\ndata](https://developers.google.com/workspace/chat/read-form-data).\n\n### setName\n\nThe name that identifies the selection input in a form input event.\n\nFor details about working with form inputs, see [Receive form\ndata](https://developers.google.com/workspace/chat/read-form-data).\n\n### getLabel\n\nThe text that appears above the selection input field in the user\ninterface.\n\nSpecify text that helps the user enter the information your app needs.\nFor example, if users are selecting the urgency of a work ticket from a\ndrop-down menu, the label might be \"Urgency\" or \"Select urgency\".\n\n### setLabel\n\nThe text that appears above the selection input field in the user\ninterface.\n\nSpecify text that helps the user enter the information your app needs.\nFor example, if users are selecting the urgency of a work ticket from a\ndrop-down menu, the label might be \"Urgency\" or \"Select urgency\".\n\n### getType\n\nThe type of items that are displayed to users in a `SelectionInput` widget.\n\nSelection types support different types of interactions. For example, users\ncan select one or more checkboxes, but they can only select one value from\na dropdown menu.\n\n### setType\n\nThe type of items that are displayed to users in a `SelectionInput` widget.\n\nSelection types support different types of interactions. For example, users\ncan select one or more checkboxes, but they can only select one value from\na dropdown menu.\n\n### getItems\n\nAn array of selectable items. For example, an array of radio buttons or\ncheckboxes. Supports up to 100 items.\n\n### setItems\n\nAn array of selectable items. For example, an array of radio buttons or\ncheckboxes. Supports up to 100 items.\n\n### getOnChangeAction\n\nIf specified, the form is submitted when the selection changes. If not\nspecified, you must specify a separate button that submits the form.\n\nFor details about working with form inputs, see [Receive form\ndata](https://developers.google.com/workspace/chat/read-form-data).\n\n### hasOnChangeAction\n\n### clearOnChangeAction\n\n### setOnChangeAction\n\nIf specified, the form is submitted when the selection changes. If not\nspecified, you must specify a separate button that submits the form.\n\nFor details about working with form inputs, see [Receive form\ndata](https://developers.google.com/workspace/chat/read-form-data).\n\n### getMultiSelectMaxSelectedItems\n\nFor multiselect menus, the maximum number of items that a user can select.\n\nMinimum value is 1 item. If unspecified, defaults to 3 items.\n\n### setMultiSelectMaxSelectedItems\n\nFor multiselect menus, the maximum number of items that a user can select.\n\nMinimum value is 1 item. If unspecified, defaults to 3 items.\n\n### getMultiSelectMinQueryLength\n\nFor multiselect menus, the number of text characters that a user inputs\nbefore the app queries autocomplete and displays suggested items\nin the menu.\n\nIf unspecified, defaults to 0 characters for static data sources and 3\ncharacters for external data sources.\n\n### setMultiSelectMinQueryLength\n\nFor multiselect menus, the number of text characters that a user inputs\nbefore the app queries autocomplete and displays suggested items\nin the menu.\n\nIf unspecified, defaults to 0 characters for static data sources and 3\ncharacters for external data sources.\n\n### getExternalDataSource\n\nAn external data source, such as a relational data base.\n\n### hasExternalDataSource\n\n### setExternalDataSource\n\nAn external data source, such as a relational data base.\n\n### getPlatformDataSource\n\nA data source from Google Workspace.\n\n### hasPlatformDataSource\n\n### setPlatformDataSource\n\nA data source from Google Workspace.\n\n### getMultiSelectDataSource"]]