1

Is there an exhaustive document of how (possibly user-added) field values are returned in the Sharepoint REST ListItem GET endpoint's response?

Afaik, most field values are returned by its EntityPropertyName (ex: abc -> {"abc": 123}), except for Lookup fields and User fields which can be returned by abc, abcId and possibly abcStringId.

Are there any other cases that I'm missing? Are there any documents that clearly explain how the field values are formatted?

0

There is no such official documentation by Microsoft.

All Field values except Lookup Field and Person Or Group field are returned by its internal name(Name provided while creating field).

For Lookup and Person Or Group Fields, you need to expand those fields like given below:

_api/web/lists/getbytitle("DisplayNameOfList")/items?$select=Title,PersonOrGroupField/Id,LookupField/Id&$expand=PersonOrGroupField,LookupField
0

No document about field property names in Json resonse. A suggestion is that before you pass item meatadata in the Rest API, you could firstly check it in Browser like:

https://xxx.sharepoint.com/sites/dev/_api/web/lists/getbyTitle('MyList4')/items

enter image description here

For Lookup and Users field, append Id into the field name, for example, a lookup field named "testlookup", then pass into metadata in ajax, it should be testlookupId, hope this is helpful to you.

  • I'll have to work on a lot of lists, and unfortunately I don't have the luxury to check all of them. I've checked the responses of a handful of lists, and I discovered that Users fields return both "testlookupId" and "testlookupStringId", which totally surprised me. I'm wondering if there's any other (known) cases that a field returns multiple values or its property name differs from the field's EntityPropertyName. – user3058273 Jan 2 at 3:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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