Forum Discussion
Conditional Formatting Document Review Dates
- May 04, 2022
Steve_Ray you can do this by formatting the column, selecting advanced mode and adding the JSON below. Note that date comparisons in JSON are done in milliseconds and I use the converter at https://convertlive.com/u/convert/months/to/milliseconds#12
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "background-color": "=if(@currentField <@now , '#c00000', if(@currentField >@now && @currentField <@now+15552000000, 'orange',if(@currentField > @now+15552000000 && @currentField < @now+31557600000, 'teal',' ')))", "color": "=if(@currentField <@now+31557600000, 'white','#363636')" } }The result is as follows:
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver).
Steve_Ray you can do this by formatting the column, selecting advanced mode and adding the JSON below. Note that date comparisons in JSON are done in milliseconds and I use the converter at https://convertlive.com/u/convert/months/to/milliseconds#12
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if(@currentField <@now , '#c00000', if(@currentField >@now && @currentField <@now+15552000000, 'orange',if(@currentField > @now+15552000000 && @currentField < @now+31557600000, 'teal',' ')))",
"color": "=if(@currentField <@now+31557600000, 'white','#363636')"
}
}
The result is as follows:
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
.