Forum Discussion

Rense620's avatar
Rense620
Copper Contributor
Oct 25, 2022
Solved

JSON change color of row based on date column

I am looking for a JSON code that changes de color of the ROW to red if it is 200 days after the date of a column. So the column says 10/12/2022 (dd/mm/jjjj) And if it today 200 days after that d...
  • ganeshsanap's avatar
    ganeshsanap
    Oct 26, 2022

    Rense620 Use JSON view formatting code like below:

     

    {
        "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
        "additionalRowClass": "=if(addDays([$Modified], 190) < @now && addDays([$Modified], 200) > @now, 'sp-field-severity--warning', if(addDays([$Modified], 200) < @now, 'sp-field-severity--blocked', ''))"
    }

     

    Documentationview-list-formatting 


    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.

Resources