Link to home
Start Free TrialLog in
Avatar of Gerhardpet
GerhardpetFlag for Canada

asked on

Using the equivalent of in operator in a query for REST API

What is the equivalent of an in operator in a query for REST API using a filter

Here is a sample URL where I filter for the customer number and I want to filter for multiple values

{{url}}/{{company}}/sales/invoices/?filter={"customer.customerNo": "CASH"}

To query this same data in the database I have

select * from customers where cust_no in ('CASH','ABC','123')
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

If you dont want to use IN then you can use OR. This should work in any DB.

select * from customers where
cust_no = 'CASH'   OR  cust_no =  'ABC'  OR cust_no =  '123'
Avatar of Gerhardpet

ASKER

Please read my question again. You missed my point.
Please try like this -

{{url}}/{{company}}/sales/invoices/?filter=("customer.customerNo": "CASH") OR ("customer.customerNo": "ABC")  OR ("customer.customerNo": "123")

You can read more from - https://sharepoint.stackexchange.com/questions/163307/rest-api-filter-multiple-values
That does not work for REST API. Do you have experience using the REST API?
ASKER CERTIFIED SOLUTION
Avatar of Gerhardpet
Gerhardpet
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I found the answer elsewhere