I have a list with a Status column and a Due Date column. I have the below JSON that highlights the Due Date column either red, yellow or green based on the relation to today's date. However, I really only want to do this if the Status column in the list is Open. Closed items should be grayed out ideally.
I'm having a hard time figuring out how to get an IF/THEN/ELSE to work with the below. I'm aiming for:
IF Status column is Open THEN apply the below formatting to the Due Date column. IF Status column is closed make the Due Date column highlighted in grey. I really appreciated any help if you have any ideas.
{
"$schema": "https: //developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"attributes": {
"class": "=if(@currentField <= @now, 'sp-field-severity--severeWarning', if(@currentField <= (@now+604800000), 'sp-field-severity--warning', 'sp-field-severity--good'))"
},
"children": [
{
"elmType": "span",
"style": {
"display": "inline-block",
"padding": "0 4px"
},
"attributes": {
"iconName": "=if(@currentField <= @now, 'ErrorBadge', if(@currentField <= (@now+604800000), 'Error', 'Forward'))"
}
},
{

