User Profile
BrandThe
Copper Contributor
Joined 10 days ago
User Widgets
Recent Discussions
JSON Conditioning with multiple IF statements
Hello I am trying to format a date column. The date in the column is a date that someone completed a certification and that certification expires after one year. I am trying to using conditional formatting comparing the date in the column against the current date to show if the certification is still valid, getting close to expiring, or expired. I can't seem to get it to work. { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "attributes": { "class": "=if((@currentField >= @now – 31536000000 && @currentField <= @now – 5184000000), 'sp-field-severity--good', if((@currentField >= @now – 5183999999 && @currentField <= @now – 2592000000), 'sp-field-severity--warning', if(@currentField >= @now – 2591999999, 'sp-field-severity--severeWarning', 'sp-field-severity--blocked'))) + ' ms-fontColor-neutralSecondary'" }, "children": [ { "elmType": "span", "style": { "display": "inline-block", "padding": "0 4px" }, "attributes": { "iconName": "=if(@currentField >= @now – 31536000000 && @currentField <= @now – 5184000000), 'CheckMark', if(@currentField >= @now – 5183999999 && @currentField <= @now – 2592000000), 'Error', if(@currentField >= @now – 2591999999, 'Warning', 'ErrorBadge')))" } }, { "elmType": "span", "txtContent": "@currentField" } ] }4Views0likes0Comments
Groups
Recent Blog Articles
No content to show