Is there a way to supply the value selected in one database dropdown field to a second database dropdown field, so that we can update the value of the latter based on what is selected in the former?
For example, I have a category table and a subcategory table, linked via many-to-one foreign key relationship. The category table has a dozen entries, each with about 20 corresponding entries in the subcategory table. Rather than have the user just be exposed to all 240 subcategories in the Subcategory dropdown, I would like them to only see the 20 subcategories relevant to the currently selected option in the Category dropdown.
I tried populating the "SQL Query" field as below to reference another fields id, but it doesn't appear like this record gets resolved at runtime:
SELECT id, name FROM subcategories WHERE subcategories.category_id = [entry.CategoryDropdown.id]
Hi @Andrew Pane
You will need to have your query to select all the options in ConfiForms Field Definition macro, and then have a ConfiForms Filed Definition Rule macro with action set to "Apply Filter on field" where you can specify a filter to reduce the options list
This rule should be set to fire on changes happening with your "category" field...
So it will work like this:
when "category" changes a "subcategory" will get a filter applied based on the value selected in the "category" field
Thanks @Sash [ConfiForms]. This answer makes sense but I can't figure out how to get it working in practice:
Category 1: Subcategory A", "
Category 1: Subcategory B", etc. Is there a more nuanced way to do this that I'm not thinking of?
Subcategory.label:Category 1*" then it indeed filters the subcategory list to all the subcategories that start with "Category 1". However, I can't figure out how to dynamically determine the category label, and none of these attempts have worked: "
Subcategory.label:Category.label*" , "
Subcategory.label:[Category.label]*" , etc.
This page claims to solve #1...
...but the example given does not work for me: clicking the "only active" checkbox results in ALL the options being filtered away.
I'm guessing this is something to do with the fact that I'm using MySQL which uses TINYINT for Boolean values, but I can't find a modification to the filter that works.
I'm not aware of any logging done by ConfiForms, so in the face of a "fail silent" plugin I don't know how to figure out what is wrong...
Alex at Vertuna has helped me out and kindly added a wiki page to their docs that showed me how to get this working:
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG