What's up with Glides AND and OR logic?

A true conversation with AI… and frankly this scares me.

Maybe you can help with this. I’ve tried a million different ways to get it to filter by

•	Time Stamp is within Today

•	And Status is New OR Status is Modified

And I can’t get it to do it. If you provide me with an explicit direction I will do that and report back what happens. Thanks

Gotcha — Glide’s filter logic is a little quirky when you want an OR condition, so here’s the exact way to do it without fighting the UI.

:one: Add helper columns in your Orders table

We’ll make two Boolean columns to simplify the filter.

1\. **Col 1:** Is Today? (If–Then–Else column)

•	IF Time Stamp → is within → **Today**

→ THEN true

→ ELSE false

2\. **Col 2:** Is New or Modified? (If–Then–Else column)

•	IF Status is New

→ THEN true

•	ELSE IF Status is Modified

→ THEN true

•	ELSE false

:two: Combine them in a third Boolean column

Name it Show in Kitchen? (If–Then–Else column):

•	IF Is Today? is true AND Is New or Modified? is true

→ THEN true

→ ELSE false

:three: Filter your Kitchen Display

In the Kitchen Display screen:

•	Set the filter to **Show in Kitchen? is true**.

:white_check_mark: That way, Glide only has to check one Boolean column, and you avoid the UI’s “can’t mix OR with AND” limitations.

This is frankly worse that C, Fortran, Pascal, dBase or even BASIC which could all handle this simple logic problem adroitly without resort to creating columns to hold intermediate calculations. And besides, what ever happened to “No Code Required”?

While Glide does some things really well it often fails on the most basic things.

Mark

Completely agree. All IF and Conditional logic in Glide is horribly designed. Can’t tell you how many times people have asked for help with simple AND/OR logic. I have this longstanding Feature Request out there already.

Usually the best suggestion is to twist around your logic a bit and kind of reverse it to get an IF column to handle AND mixed with OR. I don’t didn’t like it because it’s hard to follow and maintain it afterwards, but it’s the only solution we’ve had over the years. Unfortunately it doesn’t work for all use case.

For your case, if there was such a thing as ‘Not Within’ then I could get it all into one IF column. Otherwise, short of something hacky like “is included in ‘NewModified’”, I think the best alternative would be to use a javascript column for more complex IF logic.

1 Like