Select picker on API Rest #13749
-
Hello. I'm trying to do the following: UF is an acronym for states. When the user selects the state, only cities corresponding to the chosen state must be returned in the city field. I have already passed some conditions, filters and rules, but I was not successful. I used binding UF on query city, but I don't know if is important I want to do as this #3983 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I've been looking into this for you. I'll give you an overview of how I approached this. I've also attached an app-export for you to take a look at. I've set two REST API queries using a GET method, the first getting States/Estados and the second gets Municipalities/Municipios (forgive me, my Portuguese is non-existant). Notice the Binding added to the second query, where the binding name appears inside handlebars of the query path. You can also set a default here if no value is specified. This can be useful for debugging. . In the design tab, my component tree looks like this Where the first State Data Provider simply returns all states, and feeds them into the State options picker. (You should take care to set the Limit in the Data Provider high enough to return all options) The Municipality Data Provider is set slightly differently, it includes on extra step. Clicking the sprocket/cog next to the Data setting will open up a bindings menu . In the bindings menu you will need to specify a value for UF in the URL of your Municipality/Municipios query. This allows that value to be passed into the data tab, so it knows which state you're specifying when running the query. I'm setting it with the value of the above field using handlebar notation. The result is that the Municipality/Municipios options picker shows options dependant on the State options picker. As your Municipality/Municipios picker depends on States/Estados, you should set Municipality/Municipios to disabled, and in the Conditions tab on the right you can add a condition to update the disabled setting to unchecked (enabled) if the State/Estados field is not empty. This will help keep your users on track and ensure you get good quality data from your form. Hope this helps. If you have any more questions please let us know! |
Beta Was this translation helpful? Give feedback.
-
Thank you!! After thinking so much I had got to resolve it! I followed the same way that you!! |
Beta Was this translation helpful? Give feedback.
-
I followed the same step to district! |
Beta Was this translation helpful? Give feedback.
Hi @jaquelinedealmeida
I've been looking into this for you. I'll give you an overview of how I approached this. I've also attached an app-export for you to take a look at.
13749-export-1716465337141.tar.gz
I've set two REST API queries using a GET method, the first getting States/Estados
and the second gets Municipalities/Municipios (forgive me, my Portuguese is non-existant).
Notice the Binding added to the second query, where the binding name appears inside handlebars of the query path. You can also set a default here if no value is specified. This can be useful for debugging.
.
In the design tab, my component tree looks like this
Where the first State Data Provider simply returns al…