You can use a Variable data source to populate dropdown values from a JSON form variable.
Note: The data source must be a JSON type Form Variable. Process
variables cannot be used for this configuration.
To configure the Dropdown widget to use the JSON Variables for populating the values:
Given the following JSON variable:
{
"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 configuration would be:
| Property | Value |
|---|---|
| Path to Array in JSON | response.data.available_cars |
| ID Property | car_id |
| Label Property | car_name |
Dropdown widgets support a default JSON structure that does not require additional configuration. For the following JSON variable:
{
"data": [
{
"id": "default-pet-1",
"name": "Dog"
},
{
"id": "default-pet-2",
"name": "Cat"
},
{
"id": "default-pet-3",
"name": "Parrot"
}
]
}
Studio Modeler automatically populates the dropdown without requiring the Path, ID Property, or Label Property settings to be configured manually.