Forum Discussion
Chauc3r
Jul 31, 2020Copper Contributor
Column Formatting Json - AND operator in IF statement.
I'm trying to include an AND operator in my column formatting JSON and it's just not working.
Would love it if someone could explain what I'm doing wrong?
Cheers
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"attributes": {
"class": "=if([$GIN_x0020_Date] < @now - 86400000000,' ', if([$GIN_x0020_Date] < @now,'sp-field-severity--warning',if([$GIN_x0020_Date] < @now +86400000,'sp-field-severity--warning',if(AND([$GIN_x0020_Date] == 0,[$Calendar_x0020_Date] < @now +864000000),'sp-field-severity--severeWarning', 'sp-field-severity--good'))))"
},
"children": [
{
"elmType": "span",
"style": {
"display": "inline-block",
"padding": "0 4px"
},
"attributes": {
"iconName": "=if([$GIN_x0020_Date] < @now - 86400000000,'Forward',if([$GIN_x0020_Date] < @now, 'ErrorBadge',if([$GIN_x0020_Date] < @now +86400000,'CheckMark','CheckMark')))"
}
},
{
"elmType": "span",
"txtContent": "@currentField"
}
]
}
No RepliesBe the first to reply