使用REST过滤SharePoint列的空值 [英] Filter null value for SharePoint column using REST
问题描述
亲爱的所有,
Dear All,
我试图根据我的"EmpData"获取数据名单。我能够获得以下Rest API查询的确切行,直到我不包含"Null"。我休息过滤
I am trying to fetch the data based on my "EmpData" list. I am able to get the exact rows for the below Rest API query ,Till I don't include "Null" filtration in my below rest
var oDataUrl = siteUrl + "/_api/web/lists/GetByTitle('EmpData')/items?$top=50000&$Select=ColumnA,ColumnB,ColumnC,ColumnD,ID&$filter=((Country eq 'USA')or(EMPScore eq '500')or(Department eq 'HR')or(TechSkill eq 'CRM')or(State eq 'LA'))and(years eq '27')
但是当我添加列"结果"时,我没有得到任何结果 as (结果eq
'null')过滤空值 使用我的下面的Rest API
But I don't get any result when I add the Column "Result" as (Result eq 'null') to filter null values with my below Rest API
推荐答案
您好,
目前,ODATA for SharePoint REST不支持基于null的过滤。
Currently, the ODATA for SharePoint REST does not support the filtering based on null.
作为解决方法,我们可以使用REST API中的CAML查询来过滤列表项。
As a workaround, we can using CAML Query in REST API to filter the list items.
_api/web/lists/GetByTitle('listname')/GetItems(query=@v1)
有关同一问题的更多信息供您参考:
More information about the same issue for your reference:
https://techencapsulator.wordpress.com/2015/04/03/sharepoint-2013-odata-literal-null-comparisons/
最好的问候,
这篇关于使用REST过滤SharePoint列的空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!