Not getting same fields properties for list properties API and file properties API in Sharepoint

Abdul Saif Babu 61 Reputation points
2021-03-31T10:52:49.617+00:00

Custom metadata names are retrieved differently for List endpoint vs file endpoint
1.
when we are calling rest api = "/_api/Web/GetFileById('" + fileGuid + "')/ListItemAllFields"
output =
singlevaluegroup
lookupsltext
lookupnum
lookupdate

2

when we are calling rest api = "/_api/Web/Lists(guid'listGuid')/Fields"
output =
SingleValueGroupId,
SingleValueGroupStringId,
LookupSltextId,
LookupnumId,
lookupDateId,

"Id" and "StringId" is appended in second rest call. Kindly explain why does this happen

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,737 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MichaelHan-MSFT 18,016 Reputation points
    2021-04-01T08:40:55.54+00:00

    Hi @Abdul Saif Babu ,

    For list REST API endpoint /_api/Web/Lists(guid'listGuid')/Fields , it's to get the fields basic information created in this list.

    For listItem REST API endpoint /_api/Web/Lists(guid'listGuid')/Items(id), it would retrieve the field values in the item. For lookup and person type columns, the field value would be displayed like this: columnNameId:<id>. That's what SharePoint works for the special columns in REST API.

    And you could exapand the person columns for details like this: /Items(id)?$select=singlevaluegroup/Name&$expand=singlevaluegroup

    83528-image.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.