Why does the JSON script not work?

Lopez, Ahiezer 216 Reputation points
2023-01-18T16:36:21.24+00:00

I am looking to use a JSON script to set a column equal to a calculated JSON script. However, the column itself is blank so I tried using a simpler JSON script. I formatted the distance column with the following JSON script. Both distance and TempInfo are text data types. What am I doing wrong?

{  
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",  
  "elmType": "div",  
  "txtContent": "=[$TempInfo]"   
}

Column with JSON Script:

User's image

TempInfo Column:

User's image

Result:

User's image

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,182 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,559 questions
0 comments No comments
{count} votes

Accepted answer
  1. Emily Du-MSFT 39,446 Reputation points Microsoft Vendor
    2023-01-19T02:25:02.99+00:00

    Select distance column -> Column settings -> Format this column -> Advanced mode -> Add following codes.

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "elmType": "div",
      "txtContent": "=[$TempInfo]"
    }
    

    You should use [$ColumnName] to reference another column, the ColumnName need to be the internal name instead of the display name. To check the internal name of the column, you could check it in the URL.

    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 additional answers

Sort by: Most helpful