IF condition for dropdowns hooked to map() REST API

Continuing the discussion from Populate Dropdown field:

Post above was very helpful pulling data from a REST API using map() to populate dropdown fields and other data from schema as i am very new to SAP development. Now I have two questions…

  1. How would you approach using an IF conditional to make another dropdown/ and or input appear based on a specific data set from REST API that uses map() in the Option List from the selected dropdown? For example, a user selects a concept –> based on that concept, another dropdown appears below that displays other options specific to the concept selection. I have a table with ALL concepts, then other tables created for other options based on each concept. I’m familiar with the show/hide components from the market, but using IF conditionals with those pulling from a REST API gets tricky & frustrating real quick… HELP!

  2. Is there a way to create a dropdown within a dropdown in AppGyver?

Hi @Joe_Hutchins,

  1. I’m afraid there is no easy fix for this, but instead of show/hide component, you can bind the Visible field (under Advanced) of a dropdown to a conditional formula – let’s say your first dropdown component’s value is bound to pageVars.firstChoice and if it’s apple you want to show one dropdown and banana another. → You would bind the respective second dropdown visibilities to pageVars.firstChoice === "apple" and pageVars.firstChoice === "banana".

  2. Haven’t seen this being done before – it would be possible to build from scratch, but it will require some pretty complex logic and layouting. :slight_smile:

1 Like

This solution works perfectly thank you.
However, there is a way to use the Show/Hide components for this solution:

  • Set secondary drop downs Visibility to false

  • Set the IF condition in the original dropdown logic flow to trigger once the Event: property ‘selected value’’ changed

  • IF pageVars.firstChoice === “apple” then bind the Show Component to the ‘apple’ dropdown, else bind to Hide Component

2 Likes