我在Sharepoint 2010中获得了一个带有选择列的列表.选项是复选框.
如何使用其余的api查询选择列?
我试过用了
http://sp2010/_vti_bin/listdata.svc/mylist?$filter=myChoicesColumn/xxx eq something
Run Code Online (Sandbox Code Playgroud)
然后我明白了
类型'System.Collections.Generic.IEnumerable`1 [[Microsoft.SharePoint.Linq.DataServiceEntity,Microsoft.SharePoint.Linq,Version = 14.0.0.0,Culture = neutral,PublicKeyToken = 71e9bce111e9429c]]'中不存在属性'xxx'在第6位.
我应该使用什么属性?
这些答案都不适用于多选类型的SP字段(即表示为复选框的字段).
如果您在名为"分组"的多选选项字段上尝试以下过滤器,如下所示:
$filter=Grouping/Value eq 'My Value'
你会收到错误:
{
"error": {
"code": "",
"message": {
"lang": "en-US",
"value": "No property 'Value' exists in type 'System.Collections.Generic.IEnumerable`1[[Microsoft.SharePoint.Linq.DataServiceEntity, Microsoft.SharePoint.Linq, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c]]' at position 9."
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
也许Value
不是必需的?你仍然会收到错误.在SP 2013中,MSDN文档声明无法查询多选项.所以我只能假设2010 REST API也是如此,它几乎没有记录.
查询多值查找字段和用户由于多值查找字段是作为多个值的字符串返回的,因此无法查询它们(例如,不支持等效的Includes元素或NotIncludes元素).
http://msdn.microsoft.com/en-us/library/fp142385(v=office.15).aspx
只是一个镜头:
你试过了吗
http://sp2010/_vti_bin/listdata.svc/mylist?$filter=myChoicesColumn contains something
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
13956 次 |
最近记录: |