Forum Discussion
MrDavidGP
May 08, 2025Copper Contributor
SharePoint Lists overdue date shade cell
Hi folks, I'm muddling trough with SharePoint and would love help with something that's been a pain for days! I have a List for an Issue tracker and a column for "Date reported" what I would lo...
- May 09, 2025
MrDavidGP you can do this with the following JSON:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "background-color": "=if(@currentField < @now && @currentField > addDays(@now, -5), 'teal', if(@currentField <= addDays(@now, -5) && @currentField > addDays(@now, -10), 'orange', if(@currentField <= addDays(@now, -10), 'red', 'white')))", "color": "=if(@currentField <= addDays(@now, -5) && @currentField > addDays(@now, -10), 'black', 'white')", "padding-left": "4px" } }
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
Rob_Elliott
May 09, 2025Silver Contributor
MrDavidGP you can do this with the following JSON:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if(@currentField < @now && @currentField > addDays(@now, -5), 'teal', if(@currentField <= addDays(@now, -5) && @currentField > addDays(@now, -10), 'orange', if(@currentField <= addDays(@now, -10), 'red', 'white')))",
"color": "=if(@currentField <= addDays(@now, -5) && @currentField > addDays(@now, -10), 'black', 'white')",
"padding-left": "4px"
}
}
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
MrDavidGP
May 09, 2025Copper Contributor
Hi Rob,
Thanks so much as that worked a treat, also the white text was a bonus, thanks for doing that as well.
I'm slowly buy mostly trial and error and loads of Youtube (experts in SP) videos.
David