listdata.svc中的$ expand属性 [英] $expand property in listdata.svc

查看:106
本文介绍了listdata.svc中的$ expand属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SharePoint 2010网站中有一个图书馆.在该库中,有一个查找列XYZ-Units(显示名称).查找列从另一个列表中选择值.我正在将_vti_bin/listdata.svc与$ expand和$ select一起使用,但无法获取 查找列.默认情况下,它给出的是id而不是值.我不确定$ expand属性要使用哪个名称.

I have a library in SharePoint 2010 site. In that library there is a lookup column XYZ-Units (Display Names). The look up column picks value from another list. I am using the _vti_bin/listdata.svc with $expand and $select but not able to get the value of the lookup column. By default it gives the id not the value. I am not sure which name to use with $expand property.

错误表明没有任何具有此名称的属性

The error says there is no property with this name

显示名称为Xyz单位

内部名称为Xyz_x002d_Units

Internal name is Xyz_x002d_Units

我尝试了$ expand = XyzUnits 

I tried $expand=XyzUnits 

          $ expand = Xyz_x002d_Units

          $expand=Xyz_x002d_Units

          $ expand = Xyz单位

          $expand=Xyz-Units

没有任何效果.相同的错误

Nothing worked. Same error

推荐答案

您好,spadminspadmin,

Hi spadminspadmin,

在我的环境中,我创建一个名为"list3"的列表.然后,我创建一个名为"list4"的列表.以及名为"look1"的查找字段.到标题" list3中的字段.

In my environment, I create a list named "list3". Then I create a list named "list4" and a lookup field named "look1" to the "Title" field in list3.

然后在IE中键入下面的URL,以获取查找列的实际名称.在我的环境中,我们可以在REST API中使用的查找列的名称为"Look1".我们应该使用完全相同的名称"Look1".如果我们在REST API中使用"look1",则无法 工作.

Then type the URL below in the IE to get the actual name of the lookup column. In my environment, the name of the look up column which we can use in REST API is "Look1". We should use exactly the same name "Look1". If we use "look1" in the REST API, it cannot work.

http://sp:43274/_vti_bin/ListData.svc/List4

http://sp:43274/_vti_bin/ListData.svc/List4

然后,我们可以使用下面的URL来获取查询列的值.

Then we can use the URL below to get value of the lookup column.


select = Look1/Id,Look1/Title&
select=Look1/Id,Look1/Title&


expand = Look1> http://sp:43274/_vti_bin/ListData.svc/List4?
expand=Look1">http://sp:43274/_vti_bin/ListData.svc/List4?


这篇关于listdata.svc中的$ expand属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆