SharePoint ListData.svc“包含”字符串过滤器运算符

时间:2012-07-13 21:17:14

标签: jquery sharepoint

我正在使用getJSON从SharePoint检索列表项,如下所示:

  

[site url] / _ vti_bin / listdata.svc / Keywords?filter = startswith (Title,'r')

我想更改它以检索此内容:

  

[site url] / _ vti_bin / listdata.svc / Keywords?filter = contains (Title,'r')

失败了。 ListData.svc是否有“包含”运算符?

3 个答案:

答案 0 :(得分:14)

良好的语法是:

 [site url]/_vti_bin/listdata.svc/Keywords?$filter=substringof('r',Title) 

此处列出了所有运营商: http://msdn.microsoft.com/en-us/library/cc907912.aspx

答案 1 :(得分:1)

由于ListData.svc遵循OData协议,因此您可以尝试substringof。我自己从未尝试过,但它应该有用。

答案 2 :(得分:-1)

是的,我在查询中使用了这个,我必须检查&找到包含单词notesField的{​​{1}},因此我使用了以下REST URL:

  ?

_api /网络/列表/ getbytitle( 'SecureSystemData')/项目$选择= SNotes&安培; $滤波器= substringof( '下载',SNotes)

第二个参数是字段名称,即内部列名称。

感谢。

相关问题