JSON formatting column if date is on or 5 days within due date

New Contributor

I want the Latest Test Date to show as red if it is NOT 5 days before or after HRC Next Submission Date

table.png

 

Here is what I have so far that does't work:

 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
     "txtContent": "@currentField",
    "style": {
       "background-color": 
       
       {
          "operator": "?",
          "operands": [
            "=length([$Latest_x0020_Test_x0020_Date]) > 0",
            {"operator":"?",
            "operands":[
                {"operator":"<",
                "operands": [
                    "[$Latest_x0020_Test_x0020_Date]","[$HRCNextSubmissionDate]"
                ]},"",
            
            {"operator":"?",
            "operands":[
                {"operator":"<","operands":[
                    "[$Latest_x0020_Test_x0020_Date]",
                    {
                       "operator": "+",
                       "operands": [
                          "[$HRCNextSubmissionDate]",
                          432000000
                       ]
                    }]},"green","red"

            ]},""
            ]}
            
            ,""
          ]
          
       }
    }
 }

 

 

 I'm really new to this.  Please help

0 Replies