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...
SOE_Tech
Feb 21, 2023Brass Contributor
Can i be so bold and ask how to to "nothing" if the current field is empty?
With the current JSON the empty fields get red as well
With the current JSON the empty fields get red as well
Rob_Elliott
Feb 19, 2024Bronze Contributor
SOE_Tech if the current field is empty then use =if(Number(@currentField)==0,'', if.....
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"font-weight": "bold",
"background-color": "=if(Number(@currentField) == 0, '', if(@currentField <= addDays(@now, 30), 'red', if(@currentField > addDays(@now, 30) && @currentField < addDays(@now, 60), 'orange', '#006666')))",
"color": "white"
}
}
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)