You can use items_page and use the operator field in the query_params when setting the rules, as said in the documentation here.
You can insert the operator inside a specific rule: query_params: {rules: {column_id: "timeline", compare_value: ["2023-06-30", "2023-07-01"], compare_attribute: "START_DATE", operator:between}
You can also use the operator for rules themselves: query_params: {rules: [{column_id: "people", compare_value: ["Person 1", "Person 2"], operator:contains_text} {column_id: "status", compare_value: [1, 0]}]operator:and}
How can I now add an extra criteria that says that the Status of the project is “Stuck”, i.e. find projects that are stuck, whose duration is either lower than 5 or higher than 100?
In pseudo-code this would be an expression like:
(DurationDays < 5 OR DurationDays > 100) AND Status = ‘Stuck’
Notice I’m combining the OR operator with the AND operator. In the UI I would do this using the “Add new group” button, but I don’t know the equivalent way to do this via the API.
Nesting an array of rules inside a parent rule makes sense to me, for this requirement, but it doesn’t appear to work. I keep getting parse error and red squiggles in the API playground.
Could you give it a try on your end? I might be messing something up with parentheses.
Can you share the query_params you have ended up with? I am guessing you’ve been playing around with it more than just the example I provided. I will try on my end as well.
I’ve reviewed your question regarding filtering items on Monday.com via the API using “and” and “or” combination criteria, and I managed to find a solution that might be helpful to you.
After exploring different approaches, I was able to craft a query that utilizes nested rules within groups to combine “and” and “or” logic as follows:
Has anyone been able to make this query work? when I put it in the playground I get an error message saying the query_params object doesn’t contain a groups field.