Help needed for the filter-condition for dropdowns

Hello all,

I have 3 tables, Order, OrderLines and Items

Items have a Category (like Kitchen or Bathroom)
An Order can be for only 1 Category, say Kitchen .

When adding a new Order the user chooses the Category e.g. Kitchen and next should only be able to add OrderLines for Items that belong to the same chosen Order.Category Kitchen.

Item-field in OrderLine is a reference to Items with a dropdown filter “choice.Category == $Order.Category”. But that doesn’t work. How come?

One thing I already figured out is that new, empty OrderLines don’t directly have the correct Order-reference filled by default. That only appears after I have use Enter on an OrderLine field.

Who can show me the right direction?

Im struggling with filter conditions for dropdown too. One thing I found was that where I expected to have to use dot notation like when you said “$Order.Category”, I only had to use the column name from the current table, not point out the name of the reference table or the referenced column.

So I think the format is choice.[name of column in reference table] == $[name of column in current table]

So perhaps try choice.Category == $Category

If someone else can help me with a follow-up question - how can I put multiple filter conditions in?

My use case is similar to the OP, but I want my drop down list to show items only in the matching category AND from the matching Supplier.

I’ve tried: “AND(choice.Category == $Category, choice.Supplier = $Supplier)” - didn’t work - as well as a few variants such as listing the conditions on separate lines, but I can’t figure out the syntax for multiple conditions.

Hi
Your suggestion for categorie= worked. Thanks!
Since grist is python syntax based: have you tried “( a = b and c > d)” ?

Ahh yes, that did it thanks!