Display Dynamic Dropdown options based on input

Hi,

I have created two dropdowns which query a collection pulled from firestore (all works fine and I can see the dynamic values in the dropdown). I want to understand how we create a dynamic dropdown so if user selects an option in dropdown 1 then dropdown 2 will display options based on what was selected in dropdown 1.

In my collections I have created a categories collection which then has 32 'documents' and then in my other subcategories collection I have created a list of items which I want to display in dropdown 2. The subcategories collection reference my categories collection.

If dropdown isn't the best way to achieve this I am open to other suggestions however due to the number of items I wanted to display for a user to select I thought a dropdown would be the best option.

Thank you in advance.

2
1 reply