Forum Discussion
ChiefKeefe
May 07, 2020Copper Contributor
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...
- 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 GallardosMicrosoft Power Automate Community Super User
RobElliott
May 07, 2020Silver Contributor
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
ChiefKeefe
May 07, 2020Copper Contributor
RobElliott and Alireza Rahimifarid Thanks so much for the assistance! I really appreciate it!