The advanced properties for a Variable dropdown field are:
Property | Description |
---|---|
Form variable (JSON) | Specifies which form variable is to be used by the runtime application to populate the dropdown options. |
Path to array in JSON | Specifies the path where the dropdown option data is located, for example: response.data.available_cars |
ID property | Informs the runtime application which element in the variable value is to be used as an ID for each dropdown option. This value is used as a payload when the user selects a dropdown option. For example: car_id. |
Label property | Informs the runtime application which element in the variable value is to be used as the label for each dropdown option. This is what the user sees in the dropdown list when selecting it. For example: car_name. |
You must create a JSON type Form Variable, not a Process Variable, prior to configuring a dropdown field to use it. If no such Variable exists, the only selectable option available when configuring the dropdown field is: No form variable (JSON).
The following is an example of a Form Variable in JSON format:
{ "response": { "data": { "available_cars": [ { "car_id": 1, "car_name": "Ferrari 458", "car_price": "500000" }, { "car_id": 2, "car_name": "Lamborghini Urus", "car_price": "150000" } ] }, "pagination": { "maxItems": 100 } } }
The modeling application also supports JSON variables structured according to a default configuration. Provided that the data in the JSON type Form Variable has the proper structure, the data is displayed correctly in the dropdown field without needing to specify the path, ID, and label values at the modeling level. The default configuration is the following:
Property | Default |
---|---|
path | data |
ID | id |
label | name |
The following is an example of a JSON variable with this structure:
{ "data": [ { "id": "default-pet-1", "name": "Dog" }, { "id": "default-pet-2", "name": "Cat" }, { "id": "default-pet-3", "name": "Parrot" } ] }