Help

How to use "OR" in filterByFormula API field?

Topic Labels: API
Solved
Jump to Solution
1078 1
cancel
Showing results for 
Search instead for 
Did you mean: 
TFP
6 - Interface Innovator
6 - Interface Innovator

I’ve successfully applied both those conditions distinctly:

  • filterByFormula: {customerOwnerRef} = ''
  • filterByFormula: {customerOwnerRef} = '${process.env.NEXT_PUBLIC_CUSTOMER_REF}')

But I don’t understand how to make a logical OR between both conditions, I tried the following but it fails with INVALID_FILTER_BY_FORMULA error:

  • filterByFormula: {customerOwnerRef} = '${process.env.NEXT_PUBLIC_CUSTOMER_REF}' OR({customerOwnerRef} = '')
1 Solution

Accepted Solutions
TFP
6 - Interface Innovator
6 - Interface Innovator

Nevermind, I found the solution while writing the question.

filterByFormula: OR({customerOwnerRef} = '${process.env.NEXT_PUBLIC_CUSTOMER_REF}', {customerOwnerRef} = ''),

See Solution in Thread

1 Reply 1
TFP
6 - Interface Innovator
6 - Interface Innovator

Nevermind, I found the solution while writing the question.

filterByFormula: OR({customerOwnerRef} = '${process.env.NEXT_PUBLIC_CUSTOMER_REF}', {customerOwnerRef} = ''),