Here’s how you can correctly handle dynamic select box population in UiPath Forms using UiPath.Form.Activities v25.10.0, especially when you want one dropdown (say City) to depend on another dropdown (say State).
Scenario Example
You have two dropdowns:
- Dropdown 1: State
- Dropdown 2: City
When the user selects a State, the City dropdown should show only cities from that state.
Key Concepts
In UiPath.Forms, this kind of behavior is achieved using:
- Form Data Binding
- Dynamic Data Sources
- Set Form Values activity at runtime
However, many users face issues in recent versions (25.10.0+) because of how Set Form Values works — it cannot directly rebind the data source of a Select Box during runtime unless the form JSON is correctly structured.
Recommended Solution Steps
Configure your Form JSON correctly
Make sure the City dropdown is configured to accept a variable list as its data source.
In the Form Designer:
- Select your City dropdown.
- In Options Source, select Variable.
- Give it a variable name, e.g.
cityList.
That means your dropdown options come from a variable cityList that you will set dynamically.
Define the form data in UiPath
In the Create Form or Show Form activity, add these form data bindings:
{
"state": "",
"city": "",
"cityList": []
}
Use “Set Form Values” activity
Now, when the user selects a state, trigger a Set Form Values activity to update the cityList variable dynamically.
For example:
If selectedState = "Maharashtra" Then
cityList = New List(Of JObject) From {
New JObject(New JProperty("label", "Mumbai"), New JProperty("value", "Mumbai")),
New JObject(New JProperty("label", "Pune"), New JProperty("value", "Pune"))
}
ElseIf selectedState = "Punjab" Then
cityList = New List(Of JObject) From {
New JObject(New JProperty("label", "Amritsar"), New JProperty("value", "Amritsar")),
New JObject(New JProperty("label", "Ludhiana"), New JProperty("value", "Ludhiana"))
}
End If
Then use Set Form Values like:
{
"cityList": cityList,
"city": ""
}
This will dynamically update your Select Box options during runtime.
Important Notes (specific to v25.10.0)
- Ensure that your variable names in the Form Designer exactly match the keys you pass in Set Form Values.
- Avoid binding the Select Box to both a static list and a variable source at once — only variable.
- Use onChange events in the first dropdown (
state) to trigger a workflow rule or an external call to update the second.
Extra Tip
If you’re embedding logic directly in the form (via Rules → Actions):
Example Summary
| Step |
Component |
Action |
| 1 |
Form Designer |
Set City Select Box data source = cityList |
| 2 |
Form Data |
Initialize cityList = [] |
| 3 |
On State Change |
Trigger Set Form Values |
| 4 |
Set Form Values |
Pass { "cityList": updatedCityList } |