15
Views
2
Comments
Solved
Cascading Dropdowns (Country → State → City) not pre-filling on Edit in Employee Form

Hi Team,

I have an Employee Registration Form with three dropdowns:

         Country → State → City (cascading dropdowns).

         On Create, everything works fine: when I select Country, State refreshes; when I select State, City             refreshes.

But the issue is with Edit/Update:

        When I open an existing employee record, the saved Country, State, and City values are not                           automatically selected in the dropdowns.

        Country is showing, but State and City are not pre-filled unless I change the dropdown again.

When I edit an employee record, the dropdowns should automatically show the previously saved Country, State, and City without user interaction. 

"I have attached a small oml with my Employee Registration form for reference"

Can anyone suggest the best way to handle this scenario.

DropdownFilterstask.oml
2016-04-22 00-29-45
Nuno Reis
 
MVP
Solution

Hello.

When editing, the screen variables aren't aware of the Employee choices.

After fetching Employee, assign values to the screen variables. Only after the values are set, you can fetch data for countries/states/cities. This way the filters will work as you want them to, and the selected option will be the right one in all three dropdowns.

2024-07-12 05-57-50
Gourav Shrivastava
Champion

Hello @Thimmisetty surendrababu ,

For that usecase you need to fetch data based on previous selected country and all values of state with that country and also all values from city with that state.

You also need to select by default previous selected values of all

If user change country then you refresh and fetch the all data again state and city


Overall you need to prepare city state and country list before page render that you bind with that dropdowns 

2016-04-22 00-29-45
Nuno Reis
 
MVP
Solution

Hello.

When editing, the screen variables aren't aware of the Employee choices.

After fetching Employee, assign values to the screen variables. Only after the values are set, you can fetch data for countries/states/cities. This way the filters will work as you want them to, and the selected option will be the right one in all three dropdowns.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.