Wednesday, September 12, 2018

REST API to filter null values for SharePoint list items

I am working for SharePoint online and I came crossed to get sharepoint list items based on null values via OTB web-part. Using IE browser I came to knew that I finding no luck to crack it.

Solution:

1. Use @v1 parameter for your rest api
2. And append the caml query @v1using $select

http://mysharepointsite/_api/web/Lists/GetByTitle('Documents1')/GetItems(query=@v1)?@v1={"ViewXml":"<View><Query><Where><And><IsNull><FieldRef Name='Selection'/></IsNull><Eq><FieldRef Name='EmpNumber'><Value Type='Text'>51457270</Value></Eq></And></Where></Query></View>"}&$select=Title