Hello,
Is is possible to dynamically change the list used in dropdown based on a variable? For example (simplified use case):
1) I have a fruits type static entity (Apple/Orange/Pear)
2) I have 3 different entity for each of the 3 fruits (Apple/Orange/Pear)
So I would like to design my app in a way that:
1) I have a dropdown list of the fruitstype allowing the users to choose between one of the 3 fruits.
2) Based on their selection, the second dropdown's aggregate list/optiontext/optionvalue will change according to their selection.
Example: If they were to choose Apple, the second dropdown aggregate list will become GetApple.list and the optiontext/optionvalue will change according.
Example: If they were to choose Orange, the second dropdown aggregate list will become GetOrange.list and the optiontext/optionvalue will change according.
Is this possible? Thank you!
Hi @Low Nico ,
Or much easier : make 3 dropdowns, each with an aggregate on another entity, and change their visibility dependant on selection.
What of the above is more natural, also depends on what your application is going to do with the choice made
Dorine
Hello Dorine,
Thank you so much, your suggestion to use data action is very helpful and I think it will solve my issue! I appreciate it!
You can use separate Dropdown for every fruit.And set the visibility of Dropdown according to the fruit selected in first dropdown.RegardsKrishnanand Pathak
Thank you for your suggestion. Yeah that was my Plan B, I was just wondering if its possible to make it cleaner without having to doing the toggle visibility method
Hello @Low Nico
Why not have the Static(Fruit) as the Parent, and Create an Entity(FruitSelection) which contains the Fruit as reference Id. So that when you query this on the screen you need to have Fruit and FruitSelection with Filter of FruitId, so you will have the dropdown of fruit, and you just need to refresh the FruitSelection entity and it will show the list base on the fruit that you selected. In this use case, you just need to have 2 queries, 1 with filter, and two dropdown, the first is the selection of the fruit, while other 1 will just refresh the list base on your filter.
Thank you for your suggestion. However, as I mentioned, this is a simplified use case, what I actually need cant be done using your method. But thank you so much for taking the time to help with this!