Populating a dropdown via API based on another dropdown choice populated via API

Hi! I managed to populate my first reference selector via CALL REST function. Now I want to populate the second one based on the id chosen in the first dropdown. This id I am sending into a new CALL REST function. However my second dropdown (also reference selector) tries to populate immediately when I enter the page because I send in the selectable objects to this dropdown that will be retrieved by the choice made in the first dropdown. Even if I refresh the page after the retrieve from the first dropdown the second dropdown can’t be selected at all.   There are alot of possible options from the second dropdown so I don’t want to create persistable objects from the API. I guess this could be a bit time consuming to constantly make API calls but this will be the way to go now at first.     This is my domain model: InsuranceCompany is regarding the first dropdown Fee is regarding the second dropdown.      
2 answers

In the loic for the second reference selector make sure the call is not performed when the input for the first reference selector is empty, then you do not have the issue that the list is automatically retrieved when opening the page.

Then on the select of the first reference selector add on on change activity that refreshes the entity to trigger the function that retrieves the data in the second reference selector and as the first selector is now not empty the call is performed.

This will also trigger the first selector datasource so you might need some logic in that retrieve to prevent this from happening.


Thanks for answer!

I have tried to achieve what you said but not really made it work.


This is my second reference selector’s microflow datasource (which will be empty while first entering the page).

The selectable objects from the second reference selector however won’t refresh after a change from the first reference selector, only the datasource microflow.

This is where I might go wrong.


How can I also update the list of selectable objects to my second reference selector and not only the datasoure microflow?