1

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 lookup field showing item in list

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

//Another lookup field in same list presenting correctly Another lookup field in same list presenting correctly

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)

Edit: Was suggested to use a select and expand to fix issue but did not resolve problem. I have added more info related to this below.

//result of resquested query (modified slightly to show information from list)

https://<>.sharepoint.com/teams/AIR/_api/web/lists/getbytitle('AIR%20Incidents')/items(238)?$select=basicSpecificLocation,peoplePerson/ID&$expand=peoplePerson

Lookup not returning ID

//Column Settings list column settings

//Internal Field Name Internal Field Name

//List Showing Lookup Exists and has values List showing lookup exists and has value

Any further help you can provide will be appriciated.

  • Can you post the rest url you are using to fetch the list items? – Ganesh Sanap Dec 11 '18 at 14:34
  • Hi, edited question with URL, it was just a simple "get back everything" – Yeti Byte Dec 11 '18 at 15:01
0

Try using below URL:

https://<>.sharepoint.com/teams/AIR/_api/web/lists/getbytitle('AIR%20Incidents')/items(238)?$select=Title,peoplePerson/ID&$expand=peoplePerson 
  • Hi Ganesh, Thanks for your help, however this solution did not work for me, I have ammeded my question with notes of how this went. – Yeti Byte Dec 12 '18 at 9:20
0

Thanks for your help.

I resolved it myself, it turned out that a lookup field wont return any Id in rest if the lookup field (i.e field/Title) is empty.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.