Sharepoint Online Rest:查找值在列表中可见,查找ID列不显示项目的ID [英] Sharepoint Online Rest: Lookup Values visible in list, lookup ID column does not reveal the Ids of the item

查看:71
本文介绍了Sharepoint Online Rest:查找值在列表中可见,查找ID列不显示项目的ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我有一个奇怪的问题。查看列表时,我可以看到查找字段填充了一个项目,这是列表中的几个查找字段之一。但是当我查看列表的休息调用结果时,
显示项目的ID没有显示,JSON中的集合是空的并且自动关闭。


//在列表中填充的查找字段,查找项目的ID为50.



//显示在REST中没有项目的查找字段



//然而,同一列表中的另一个查阅列显示相关内容。





我之前通过删除并重新创建列解决了这个问题,但问题是在第二天返回。



之前是否有人遇到此问题并知道如何修复它?


编辑:这是用于获取所有列表数据的查询.https://<> .sharepoint.com / teams / AIR / _api / web / lists / getbytitle('AIR% 20Incidents')/ items(238)

解决方案

您好YetiByte,


根据我的测试,如果没有为此字段设置值,则多值查找字段在Rest Json中将没有Id值。


您可以尝试在UI中重置查找值,然后使用此值Rest API扩展此字段以获取查找ID和值:

 https://xxx.sharepoint.com/sites/dev/_api/lists/getbyTitle(' AIR%20Incidents')/项目(1)

选择=标题,peoplePerson / ID,peoplePerson /标题&安培;?

扩大= peoplePerson



谢谢


最好的问候



I have an odd issue today. When looking at a list I can see the lookup field is populated with an item, this is one of a few lookup fields on the list. However when I look at the results of a rest call to the list none of the IDs of the item show up, the collection in the JSON is empty and self closing.

//Lookup field populated in list, ID of lookup item is 50.

//Lookup field showing that it has no items in REST

//However, another lookup column in the same list is presenting correclty.

I had resolved this before by deleting and re-creating the column, however the issue returned the next day.

Has anyone ran into this issue before and know how to fix it?

Edit: this was the query used to get all the list data back. https://<>.sharepoint.com/teams/AIR/_api/web/lists/getbytitle('AIR%20Incidents')/items(238)

解决方案

Hi YetiByte,

Based on my test, the multiple value lookup field will have no Id value in Rest Json if there is no value set to this field.

You could try to reset a lookup value in the UI and then use this Rest API to expand this field to get lookup Id and value:

https://xxx.sharepoint.com/sites/dev/_api/lists/getbyTitle('AIR%20Incidents')/items(1)?


select=Title,peoplePerson/ID,peoplePerson/Title&


expand=peoplePerson

Thanks

Best Regards


这篇关于Sharepoint Online Rest:查找值在列表中可见,查找ID列不显示项目的ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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