Dynamic option list
Last updated
Last updated
The Dynamic Option List data type in Activity Templates allows you to dynamically define the list of options that will appear within the calculator editor. This enables flexibility in your templates by allowing the options to be generated based on criteria or logic, rather than being hardcoded.
With the Dynamic Option List, you can define a set of options dynamically using a JSON-like structure. These options can be used in activity templates where the user can select one or more items. This data type is particularly useful when you need to display options based on certain conditions or calculations.
Example of a Dynamic Option List
A basic example of a SINGLE option dynamic list would look like this:
type
: Defines the type of option list (e.g., SINGLE
or MULTIPLE
).
items
: A list of items that will appear as options.
name
: The label of the option displayed to users.
value
: The underlying value for the option, which will be used in calculations.
displayOrder
: The order in which the options are displayed in the list. Options with a lower number will appear first.
pass
: A flag indicating whether the option passes certain conditions or logic.
Dynamic Option List Types
SINGLE
: The user can select only one option from the list.
MULTIPLE
: The user can select multiple options from the list.
Previewing in the Editor
When using the Dynamic Option List data type in the calculator editor, the list of options is rendered dynamically based on the defined JSON structure. You can preview the options within the editor to ensure the correct options are being displayed and that their behavior is as expected.