REST API with Multiple filters

Hi,

What is wrong with this filter parameters 

https://<Sharepoint Server URL>/_api/Lists(guid'6DA2C173-3A59-435F-A1B8-B62567B9F146')/Items?$filter MonthYear eq Apr2015 and Status eq Approved and EmployeeCodeId eq 12
August 14th, 2015 10:15am

I think you should get columns first,

I mean try this way:

https://<Sharepoint Server URL>/_api/Lists(guid'6DA2C173-3A59-435F-A1B8-B62567B9F146')/Items?$select=MonthYear,Status,EmployeeCodeId&$filter MonthYear eq Apr2015 and Status eq Approved and EmployeeCodeId eq 12

First try with only one parameter and if getting result keep on increasing :)
Free Windows Admin Tool Kit Click here and download it now
August 15th, 2015 11:05am

This will not work as my URL gives correct result for 1 parameter alright. 

however when i write multiple parameters it does not filter on anything and returns all the records.

and No select is not required. 

August 15th, 2015 2:18pm

Give it one more try:


https://[SiteUrl]/_api/web/lists/getbytitle('ListName')/items?$filter=(((MonthYear eq 'Apr2015') and  ([Status] eq 'Approved')) and ([EmployeeCodeId] eq '12'))

Refer: http://www.sharepointyammertech.com/2014/11/sharepoint-2013-rest-services-how-to.html

Free Windows Admin Tool Kit Click here and download it now
August 15th, 2015 2:36pm

Hi Parth,

Any update?

Thanks

September 1st, 2015 10:53pm

Still struggling with the same Issue. As of now i have kept the multiple filters in my c# Code (if else conditions) and created another Service Wrapper to access the records. 

Between, is queries on SharePoint Online is different then the queries on On Prem SharePoint ?

As Certain REST Queries which used to work on, OnPrem SharePoint does not work on SharePoint Online....

Free Windows Admin Tool Kit Click here and download it now
September 2nd, 2015 1:46am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics