Choice

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.

No products are required to use this action.

This action pairs well with the following actions.

State

The state will contain the value of whatever option(s) were selected. Always in 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)

NameTypeDescriptionRules
modestringThe mode is used in combination with style to determine the behavior and rendering of this action.
Examples: "single".
Possible values: single, multiple.
stylestringStyle 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.
titlestringA short title explaining the choice.
Examples: "Choose your option".
MaxLength: 64
MinLength: 3
Pattern: ^(?!\s*$).+
descriptionstringDescription of what is being chosen.
Examples: "This is an example description.".
MaxLength: 512
MinLength: 3
Pattern: ^(?!\s*$).+
optionsarray(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

NameTypeDescriptionRules
valuestring(required) What value will be saved when this option is selected.
Examples: "option_value_1".
MinLength: 1
Pattern: ^(?!\s*$).+
labelstring(required) The user friendly label for this option.
Examples: "Option Label 1".
MinLength: 1
Pattern: ^(?!\s*$).+
iconstringA material design icon name, without the mdi- prefix.
Examples: "checkbox-marked".

Context (required)

NameTypeDescriptionRules
defaultChoicesarrayArray 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 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"
            }
        ]
    }
}