acidrain
Executive Member
Hoping someone can help.
I've setup a list of certificate expirations for all our employees but am having an issue setting up the conditional format to visually indicate the following:
Expiration date < today = Highlight Red
Expiration date <= today + 60 days = Highlight Orange
Expiration date > today + 60days = Highlight Green
The default formatting does not allow for setting custom rules on the dates. You can either set today or a specific date but not something like "within 60 days from today".
The only way to do this is via Advanced formatting using JSON. After doing some google searching, I found an example but when using it, sharepoint throws an error "Enter valid column-formatting JSON".
Current code is
If someone is able to point out the problem, or perhaps point me to a better example, that would be greatly appreciated.
Thanks
I've setup a list of certificate expirations for all our employees but am having an issue setting up the conditional format to visually indicate the following:
Expiration date < today = Highlight Red
Expiration date <= today + 60 days = Highlight Orange
Expiration date > today + 60days = Highlight Green
The default formatting does not allow for setting custom rules on the dates. You can either set today or a specific date but not something like "within 60 days from today".
The only way to do this is via Advanced formatting using JSON. After doing some google searching, I found an example but when using it, sharepoint throws an error "Enter valid column-formatting JSON".
Current code is
Code:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if([$Cert] <= @now + 7776000000, '#ff8000',if([$Cert] < @now, '#FF0000',if([$Cert] > @now + 7776000000, '#008000','')))"
"padding-left": "10px"
}
}
If someone is able to point out the problem, or perhaps point me to a better example, that would be greatly appreciated.
Thanks

