Filter by formula not working when nesting

Describe the problem/error/question

Hi everyone,

I’m using the NocoDB get many node with filter by formula.

When I use a simple combination like this, it works fine:

(nombre_de_contact,lt,4)~and(date_de_contact,isWithin,pastMonth)

However, when I try to use nested logic with both ~or and ~and, like this:

((nombre_de_contact,is,null)~or(nombre_de_contact,lt,4))~and((date_de_contact,is,today)~or(date_de_contact,isWithin,pastMonth))

…it throws an invalid filter format error.

Is there a known limitation or specific syntax for combining ~or and ~and in NocoDB filters?

Thanks in advance!

What is the error message (if any)?

Invalid filter format.

Information on your n8n setup

  • n8n version: 1.95.3
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Container
  • Operating system: NixOS 25.05

Update:

I actually found the solution just after posting this :sweat_smile:
It’s explained here: Nested logic as query parameter · Issue #8835 · nocodb/nocodb · GitHub

You need to prefix the entire expression with @ to make complex nested logic work.

So this:

((nombre_de_contact,is,null)~or(nombre_de_contact,lt,4))~and((date_de_contact,is,today)~or(date_de_contact,isWithin,pastMonth))

…should be written as:

@((nombre_de_contact,is,null)~or(nombre_de_contact,lt,4))~and((date_de_contact,is,today)~or(date_de_contact,isWithin,pastMonth))

That resolved the Invalid filter format error for me.
Hope it helps someone else too!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.