i’m trying to “optimize” my app a little bit and need your help.
I have a few questions for the user whose values all come from the database.
The user first selects a year, 1965-1970. Depending on the selected year, the following dropdown list should show other data from the database. There is a database table for when the user chooses 1965, 1966…and so on
I also tried to draw this, no idea if this helps with understanding.
What is the best way to achieve this?
I honestly would have gone now and made a separate dropdown for each year and a workflow that selects a different dropdown depending on the selection. But that sounds very inefficient.
Hi there, @bubble.io.mails… if you don’t need users (i.e., anyone on the front end) to be able to add values to the dropdowns, you could consider using an option set with an attribute on the set that stores the year associated with each option. Then, defining the options for a dropdown is as easy as getting the options from the set filtered to the ones that have a specific year as their attribute.
Hey Mike,
thanks for your reply. I’m kinda lost there to be honst. Do you know if i can find it somewhere detailed in like a…step by step guide or in the docs?
As you define the options in the set above, click the Modify attributes link beside each option and enter the associated year in to the year attribute field.
Next, add a dropdown to a page that displays the years from the years option set.
Finally, add another dropdown to display the options from the other set filtered by the year that is selected in the first dropdown.
Hey, thanks! I guess that i will create different workflows…for each year individually, depending on the year input the user chose.
Thing is: I will work with “hidden” dropdown lists and will only make them appear through the workflow.
Would you say that this is “bad practice” having like 30 hidden boxes on the page? It’s just a hobby project but im wondering if this could impact the site performance.