Forum Discussion

dlprentice's avatar
dlprentice
Copper Contributor
Mar 02, 2021

How do I display the ID using JSON formatting?

I'd like to display the ID of the open item in the header using JSON formatting, is this possible?

 

I tried [$ID], but got an error that it doesn't exist.

 

Thanks

4 Replies

  • des2300's avatar
    des2300
    Copper Contributor

    Hi dlprentice

    Can you elaborate on how you did this. It does not work for me. Can you share how you added it to your JSON.

    Thanks

  • dlprentice emersonbruce Yes, it is a limitation of SharePoint list form JSON formatting.

     

    You can read more information about it at: Can ID column be displayed when configuring a list form header using JSON? 

     

    Creating a calculated column based on item ID (like =[ID]) and using it in list form JSON formatting by referring to internal name of SharePoint calculated column is a workaround which might work you for sometimes but it is not officially supported by the Microsoft:

     

    You cannot reference the ID of a row for a newly inserted row. The ID does not yet exist when the calculation is performed.

     

    SourceIntroduction to SharePoint formulas and functions 


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

  • dlprentice's avatar
    dlprentice
    Copper Contributor
    I've found a work around to my question. I created a calculated column that references [ID] which I can use in my JSON.
    • emersonbruce's avatar
      emersonbruce
      Copper Contributor
      this has always been a pet peeve of mine that id is not exposed for use.

Resources