How to get display name and internal column name of List Items of SharePoint by using Rest API of SharePoint

Sudhakar 20 Reputation points
2024-03-28T06:29:20.0833333+00:00

What is the SharePoint Rest API which fetch the display name and internal field/column name of the List Items of SharePoint ?

Currently We are following the below documentation which mentioned the below given rest API but it only return the internal field name of List Item.
https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-rest#working-with-list-items-by-using-rest

GET https://{site_url}/_api/web/lists/GetByTitle('Test')/items

Note: We are not using the graph API So please provide the answer in context of SharePoint.

Microsoft 365 and Office SharePoint Server For business
Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dennis Goedegebuure 11 Reputation points MVP
    2024-03-28T13:24:04.51+00:00

    Hi,

    You could retrieve both the internal name and title of the fields in a separate request, you could use the below URI.

    However, not sure if you can use this in an expand and combine it into one request. You might have to use some other logic to combine it with your first request.

    _api/web/lists/GetByTitle('@{variables('ListName')}')/fields?$select=Title,InternalName
    
    0 comments No comments

  2. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2024-03-29T02:45:14.5566667+00:00

    Hi @Sudhakar,

    You could use following api to get column internal name and display name

    /_api/web/lists/getbytitle('<list title>')/fields&$filter=InternalName eq 'internal'&$select=Title,InternalName
    

    Here is the test result

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.