Class SelectionInput
A widget that creates one or more UI items that users can select.
Supports form submission validation for dropdown
and multiselect
menus
only. When Action.all_widgets_are_required
is set to true
or this widget
is specified in Action.required_widgets
, the submission action is blocked
unless a value is selected. 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, see Add selectable UI
elements.
Chat apps can process the value of items that users select or input. For details about working with form inputs, see Receive form data.
To collect undefined or abstract data from users, use the [TextInput][google.apps.card.v1.TextInput] widget.
Implements
Namespace: Google.Apps.Card.V1
Assembly: Google.Apps.Card.V1.dll
Syntax
public sealed class SelectionInput : IMessage<SelectionInput>, IEquatable<SelectionInput>, IDeepCloneable<SelectionInput>, IBufferMessage, IMessage
Constructors
SelectionInput()
Declaration
public SelectionInput()
SelectionInput(SelectionInput)
Declaration
public SelectionInput(SelectionInput other)
Parameters
Type | Name | Description |
---|---|---|
SelectionInput | other |
Properties
ExternalDataSource
An external data source, such as a relational database.
Declaration
public Action ExternalDataSource { get; set; }
Property Value
Type | Description |
---|---|
Action |
HasMultiSelectMaxSelectedItems
Gets whether the "multi_select_max_selected_items" field is set
Declaration
public bool HasMultiSelectMaxSelectedItems { get; }
Property Value
Type | Description |
---|---|
bool |
Items
An array of selectable items. For example, an array of radio buttons or checkboxes. Supports up to 100 items.
Declaration
public RepeatedField<SelectionInput.Types.SelectionItem> Items { get; }
Property Value
Type | Description |
---|---|
RepeatedField<SelectionInput.Types.SelectionItem> |
Label
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".
Declaration
public string Label { get; set; }
Property Value
Type | Description |
---|---|
string |
MultiSelectDataSourceCase
Declaration
public SelectionInput.MultiSelectDataSourceOneofCase MultiSelectDataSourceCase { get; }
Property Value
Type | Description |
---|---|
SelectionInput.MultiSelectDataSourceOneofCase |
MultiSelectMaxSelectedItems
For multiselect menus, the maximum number of items that a user can select. Minimum value is 1 item. If unspecified, defaults to 3 items.
Declaration
public int MultiSelectMaxSelectedItems { get; set; }
Property Value
Type | Description |
---|---|
int |
MultiSelectMinQueryLength
For multiselect menus, the number of text characters that a user inputs before the menu returns suggested selection items.
If unset, the multiselect menu uses the following default values:
- If the menu uses a static array of
SelectionInput
items, defaults to 0 characters and immediately populates items from the array. - If the menu uses a dynamic data source (
multi_select_data_source
), defaults to 3 characters before querying the data source to return suggested items.
Declaration
public int MultiSelectMinQueryLength { get; set; }
Property Value
Type | Description |
---|---|
int |
Name
Required. The name that identifies the selection input in a form input event.
For details about working with form inputs, see Receive form data.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
OnChangeAction
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, see Receive form data.
Declaration
public Action OnChangeAction { get; set; }
Property Value
Type | Description |
---|---|
Action |
PlatformDataSource
A data source from Google Workspace.
Declaration
public SelectionInput.Types.PlatformDataSource PlatformDataSource { get; set; }
Property Value
Type | Description |
---|---|
SelectionInput.Types.PlatformDataSource |
Type
The type of items that are displayed to users in a SelectionInput
widget.
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.
Declaration
public SelectionInput.Types.SelectionType Type { get; set; }
Property Value
Type | Description |
---|---|
SelectionInput.Types.SelectionType |