JSON - Filter with OR


I am setting up api integration and need to pull a record(s) based on a telephone number being equal to phone_work or phone_mobile data.

Filtering based on one of the 2 is fine (phone_work below):


but I can’t get the syntax right to query both fields. The documentation only gives an example of AND being used and that doesn’t show 2 fields being validated.

Any ideas?




To filter on multiple fields, I think your request would possibly need a


parameter for each field?

With the


Separating them.

(Unless another user is aware of an easier/cleaner way?)

Something similar to this, perhaps?:


That should return items where both "phone_work" and "phone_mobile" are "1234", sent as a GET request to the CRM through the V8 Api

Is that similar to what you’re looking for?

1 Like

I tried with :


And it pulls up multiple records where the values don’t match.

This outcome is the same with this verion:


With AND, it will only pull up a record (correctly) when all phone fields for that record are populated with 12345


I’ve been having a look into this

You’re right in that the records don’t match the query posted

It looks like there may be an existing issue with the “OR” parameter in the V8 API:

Reportedly, a parameter gets appended for “OR DELETED = 0”
Which will return essentially all records

However, a user has submitted a fix for this:

The changes made here appear to resolve the issue

I’d given it a quick check with that change made, and results seem to be much more accurate for the “OR” condition

One thing to note though is that this change is currently not upgrade-safe, and may be overwritten by upgrades. (As it has not yet been accepted into the main project)
If you make the changes above, are you able to see more accurate results?

Perfect. Made the change and all working fine. TYVM!

Great, glad to hear it!