Customers can make a choice between the supplied options.
A stylistically flexible experience that will present a customer with the ability to choose from provided options.
Related Actions
This action pairs well with the following actions:
State
The state will store the values of the selected option(s), always as an array.
Union
When unioned there will be no accept button shown in the GUI when this action is unionized. Instead, the unionized action will be the trigger to 'save' the current selection.
Macro level details for how union attribute behaves can be found within the Union documentation.
Features (required)
| Name | Type | Description | Rules |
|---|---|---|---|
| mode | string | The mode is used in combination with style to determine the behavior and rendering of this action. Examples: "single". | Possible values: single, multiple. |
| style | string | Style of the choice feature. The appropriate value is determined by the setting of `features.mode`. If `features.mode` is `single`, the style can be `radio`, `toggle` or `selection`. If `features.mode` is `multiple`, the style can be `checkbox`, `tags` or `selection`. Examples: "radio". | Possible values: radio, toggle, selection, checkbox, tags. |
| title | string | A short title explaining the choice. Examples: "Choose your option". | MaxLength: 64 MinLength: 3 Pattern: ^(?!\s*$).+ |
| description | string | Description of what is being chosen. Examples: "This is an example description.". | MaxLength: 512 MinLength: 3 Pattern: ^(?!\s*$).+ |
| options | array | (required) Options for the choice feature. Examples: [{"value":"option_value_1","label":"Option Label 1"},{"value":"option_value_2","label":"Option Label 2"}]. | See options |
options
| Name | Type | Description | Rules |
|---|---|---|---|
| value | string | (required) What value will be saved when this option is selected. Examples: "option_value_1". | MinLength: 1 Pattern: ^(?!\s*$).+ |
| label | string | (required) The user friendly label for this option. Examples: "Option Label 1". | MinLength: 1 Pattern: ^(?!\s*$).+ |
| icon | string | A material design icon name, without the mdi- prefix. Examples: "checkbox-marked". |
Context (required)
| Name | Type | Description | Rules |
|---|---|---|---|
| defaultChoices | array | Array index values indicating the default choice(s). If `features.mode` is set to `multiple`, it can contain multiple values; otherwise, it should contain a single value. Examples: [0]. |
Example
Below is an example payload for adding an Choice action to a business process or blueprint.
{
"type": "choice",
"context": {
"defaultChoices": [
0
]
},
"features": {
"mode": "single",
"style": "radio",
"title": "Choose your option",
"description": "This is an example description.",
"options": [
{
"value": "option_value_1",
"label": "Option Label 1"
},
{
"value": "option_value_2",
"label": "Option Label 2"
}
]
}
}
