question

AbdulSaifBabu-7422 avatar image
0 Votes"
AbdulSaifBabu-7422 asked MichaelHan-MSFT commented

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

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

office-sharepoint-online
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered MichaelHan-MSFT commented

Hi @AbdulSaifBabu-7422,

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.




image.png (32.9 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MichaelHan-MSFT,

For some fields, it is appending "StringId".
So, can you please tell me, on what basis it is appending it is appending, so that we can handle in our side

0 Votes 0 ·

For person Fields, it would append "StringId". In rest api it would show two records:

 ColumnNameId: 7,
 ColumnNameStringId: "7",
0 Votes 0 ·