Filtering a dropdown based on another dropdown

Hi there, 

I'm trying to create a form that includes two dropdown items that are in a parent/child relationship.  I want the user selection in the first drop down (parent) to create a filter in the second drop down (children).  My parent is "Category" and my child is "Product".  Each Category has many Products.  I'm trying to make it easy on the user so they can select the Category on the form, and the second drop down automatically filters to include only the Products that belong to the selected Category.  Currently both drop downs are populated with the "Ref" type but they do not interact.

Perhaps I'm thinking about this upside-down somehow.  Any suggestions?

Solved Solved
0 15 4,860
  • UX
2 ACCEPTED SOLUTIONS

I imagine your form is to add a row to another table, a third one.

If this third one has CategoryId and ProductId columns, you could create your dropdown this way:

CategoryId Valid_If:

 

Category[Key]

 

ProductId Valid_If:

 

[CategoryId].[Related Products]

 

 This should be the most eficient way of doing it.

Since your products are children of your Category, you should have a [Related Products] column with all the key of the Products records.

Check if it applies and come back if you need more help

View solution in original post

Aha!  So, my schema is a little more complicated than I described and I suspect that caused the [Related Products] virtual column to NOT get created.  I added it manually, and now it worked.  For the next person, here is what you need to do with minor corrections to Skyroc's syntax...

1 - Set the first dropdown as type REF.  No other validity requirements on that in my particular case, as any parent selection is valid.

2 - Set the child column as type Ref (Enum will also work) and for "Valid If" enter "[Category].[Related Products]" ... and yes this solution does create a filtered list. 

 

Thank you Skroyc!

View solution in original post

15 REPLIES 15
Top Labels in this Space