Forum Discussion

ChiefKeefe's avatar
ChiefKeefe
Copper Contributor
May 07, 2020
Solved

Adding color in column validation

I've created a custom list in SharePoint online to track our department training. I have a date and time column titled "Expiration" that will list the date that the training/certification will expire...
  • RobElliott's avatar
    May 07, 2020

    ChiefKeefe if you wanted to make it stand out a bit more then you could apply the formatting with a background color:

     

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
      "elmType": "div",
      "txtContent": "@currentField",
      "style": {
        "background-color": "=if([$NextReview] <= @now + 604800000, '#d9184b', if([$NextReview] > @now+604800000 && [$NextReview] <= @now + 2592000000, '#ff9a00','#dddeee')",
        "color": "white",
        "padding-left": "10px"
      }
    }

     

    which gives the following result:

     

     

    Rob
    Los Gallardos

    Microsoft Power Automate Community Super User

Resources