https://discord.gg/botpress logo
#🤝help
I'm building a complex filter. How do I test a workflow variable as part of an $or expression?
# 🤝help
w

worried-queen-393

01/09/2024, 4:14 AM
want to do something like: $or: [{ Ledger: { $eq: workflow.ledger } }, { workflow.ledger $eq: false } ] Table has field: Ledger Thanks for any help
r

rich-battery-69172

01/09/2024, 2:19 PM
@worried-queen-393 only table columns can be used in the table filter expression. You could have two queries for whether workflow.ledger is false or true: eg.
Copy code
rows = await  MyTable.findRows({
filter: workflow.ledger ? { Ledger: workflow.ledger} : {}
})
w

worried-queen-393

01/09/2024, 8:53 PM
Brilliant! I'll try that tonight... Thank you