Sharepoint: Turn the text red using JSON

T-MRZ 6 Reputation points
2022-06-17T12:15:09.67+00:00

What is the code to type into the JSON field when I want that the text in the calculated column always shows as red?

Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

1 answer

Sort by: Most helpful
  1. Jinwei Li-MSFT 4,741 Reputation points Microsoft External Staff
    2022-06-20T03:05:51.907+00:00

    Hi @T-MRZ ,

    Please try to use this:

    {  
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",  
      "elmType": "div",  
      "debugMode": true,  
      "txtContent": "@currentField",  
      "style": {  
        "color":"red"  
      }  
    }  
    

    212762-image.png


    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.


Your answer

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