I’m trying to create an input form with two option set based dropdown inputs. The user selects an option for category from the first dropdown which informs the second dropdown which additional option set to present the user with its sub-categories. This is very straightforward if the choices for both dropdowns are derived from the DB. However, I’m having a challenge implementing it when both dropdowns derive their choices from Options Sets (the choice for category specifies which option set the dropdown for sub-category should use). How can I accomplish this?
Hi there, @royjay… you can go one of two ways here. You can add an attribute to the sub-category option set that links each sub-category to an option in the category option set or you can add an attribute to the category option set that defines a list of sub-categories that are associated with each category.
Regardless of which way you go, your choices source for the sub-category dropdown will be all of the sub-category options filtered to show only the options that are associated with the selected category.
Hope this helps.
Edit: if a visual would help, here is the dropdown for the sub-categories, and it is based on the sub-category option set having an attribute (called
category) that links to the category option set, with each sub-category being associated with an option from the category set.