How to create dynamic dependent dropdown

I want to create dependent dropdowns , that are dependent on each others values .
i have 3 dropdowns

  1. width
  2. height
  3. depth

i have all the valid combinations saved in a database called sizes with fields width, depth and height.

When the user is setting the value for height he should only see the values 720,1960,2080,1320 (since then are the unique values )
Then the user select width (he should only see valid options based on the height that he has selected )
Then user selects the depth (he should only see the valid options based on the width and height that he selected earlier )

These are the combinations that are valid (this is just an example , the valid options will be saved in the database , since the user will have control to change the options as an when required )
|WIDTH|DEPTH|HEIGHT|
|1000|560|720|
|1050|560|720|
|1200|560|720|
|150|560|720|
|200|320|720|
|200|560|720|
|300|320|720|
|300|560|1960|
|300|560|2080|
|300|560|720|
|400|100|720|
|400|320|720|
|400|560|720|
|450|100|720|
|450|320|720|
|450|560|1960|
|450|560|2080|
|450|560|720|
|500|320|720|
|500|560|720|
|600|100|720|
|600|320|1320|
|600|320|720|
|600|560|1960|
|600|560|2080|
|600|560|720|
|640|320|720|
|800|320|720|
|800|560|720|
|900|100|720|
|900|320|720|
|900|560|720|

I have tried a lot of thing (the unique elements gives the id and not the unique column values )
the group by function , disables the autobinding , and gives a list of things

Just constrain the choices of the second and third dropdowns by the value of the first (i.e. parent thing is previous dropdown’s value).

Or, have al list of child items on each parent, and set the choices source for dropdown 2 to dropdown 1’s children.

put a list of “usable” choices on the selections themselves

data type: width
hight choices…1,2,3
length choices…1,2,3

height
width choices
length choices

and so on

Tried this method. made a width dropdown (gave it values by searching all elements ) , make a second dropdown for height (gave it values by searching values where width = first dropdown)

This shows multiple elements , like if i select 400 width. it shows me 3 options for height that are 720, 720 and 720. buy i only want to show the unique elements (by elements i mean unique values )
there is a unique elements option in bubble , but it only works for unique id , not any other field value

if i put the choices on the selections themselves , i can probably do this once. but what happens when the user adds to the list and creates a new entry WxDxH = 1000x1000x1000 which was not in the database in the initial stage.

That’s not remotely true (I’ve no idea where you got that idea from)… :unique elements works on any type of data…

In any case, if you tried what I said and it didn’t work, you obviously did something wrong…

Without knowing more about your specific case it’s hard to say what, but I think i can probably guess your mistake…

I would suggest a database redesign (as suggested by @ksplinter007) and probably a new datatype to store User’s selections…

Although you could keep your existing data structure if you set up your dropdowns correctly.

if its user generated than you let them make lists of length widths and heights, and then they assign what ones they can be chosen with.

what are these dependant numbers for? what is the point>?

This topic was automatically closed after 70 days. New replies are no longer allowed.