Forum Discussion
SLCLARKE23
Mar 25, 2022Copper Contributor
Conditional Formatting in Sharepoint List based on expiry date within 30 days
I currently have a list which shows training. the box shades red when the training has expired and is green when it is active. I would like it to go Orange when the training is going to expire in the...
Beastie1211
Feb 28, 2025Copper Contributor
I am trying to do similar but based on last modified... upto 7 days green, up to 14 days amber and then 30 days red. But I cannot seem to crack it..
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if(@currentField >= @now-604800000, 'green', if(@currentField > @now-1209600000 && @currentField < @now-2592000000, 'amber', 'red')",
"color": "white"
}
}