Solved

REST API V2 multiple indexof

  • 17 August 2021
  • 2 replies
  • 398 views

Hi, 

We are using API Version 2 - there seems to be a bug with $filter=contains so am using indexof. My question is, how can I use multiple indexof ie. where name = ‘something’ OR postcode = ‘something’ OR Address = ‘something’. 

/api/v2/odata/Company/Erp.BO.CustomerSvc/Customers?$select=CustID%2CName%2CCompany&$orderby=Name&$filter=indexof(Name, 'something') gt 0

icon

Best answer by KielT 17 August 2021, 16:20

View original

2 replies

Question resolved. This is achievable by creating a BAQ with a parameter then calling the BAQ through the API.

indexof(Name,'Sm') gt 0 and indexof(Zip, 'St') gt 0

This example is using indexof for Name containing ‘sm’ and Zip/Postcode containing ‘st’

You could put or instead of and inbetween the indexof so it could include one of the matches.. or both.

 

 

Reply