Column Formatting Json - AND operator in IF statement.

%3CLINGO-SUB%20id%3D%22lingo-sub-1559476%22%20slang%3D%22en-US%22%3EColumn%20Formatting%20Json%20-%20AND%20operator%20in%20IF%20statement.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1559476%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20trying%20to%20include%20an%20AND%20operator%20in%20my%20column%20formatting%20JSON%20and%20it's%20just%20not%20working.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EWould%20love%20it%20if%20someone%20could%20explain%20what%20I'm%20doing%20wrong%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%7B%3CBR%20%2F%3E%22%24schema%22%3A%20%22%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%3C%2FA%3E%22%2C%3CBR%20%2F%3E%22elmType%22%3A%20%22div%22%2C%3CBR%20%2F%3E%22attributes%22%3A%20%7B%3CBR%20%2F%3E%22class%22%3A%20%22%3Dif(%5B%24GIN_x0020_Date%5D%20%26lt%3B%20%40now%20-%2086400000000%2C'%20'%2C%20if(%5B%24GIN_x0020_Date%5D%20%26lt%3B%20%40now%2C'sp-field-severity--warning'%2Cif(%5B%24GIN_x0020_Date%5D%20%26lt%3B%20%40now%20%2B86400000%2C'sp-field-severity--warning'%2C%3CFONT%20color%3D%22%23FF0000%22%3Eif(AND(%5B%24GIN_x0020_Date%5D%20%3D%3D%200%2C%5B%24Calendar_x0020_Date%5D%20%26lt%3B%20%40now%20%2B864000000)%3C%2FFONT%3E%2C'sp-field-severity--severeWarning'%2C%20'sp-field-severity--good'))))%22%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22children%22%3A%20%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22elmType%22%3A%20%22span%22%2C%3CBR%20%2F%3E%22style%22%3A%20%7B%3CBR%20%2F%3E%22display%22%3A%20%22inline-block%22%2C%3CBR%20%2F%3E%22padding%22%3A%20%220%204px%22%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22attributes%22%3A%20%7B%3CBR%20%2F%3E%22iconName%22%3A%20%22%3Dif(%5B%24GIN_x0020_Date%5D%20%26lt%3B%20%40now%20-%2086400000000%2C'Forward'%2Cif(%5B%24GIN_x0020_Date%5D%20%26lt%3B%20%40now%2C%20'ErrorBadge'%2Cif(%5B%24GIN_x0020_Date%5D%20%26lt%3B%20%40now%20%2B86400000%2C'CheckMark'%2C'CheckMark')))%22%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22elmType%22%3A%20%22span%22%2C%3CBR%20%2F%3E%22txtContent%22%3A%20%22%40currentField%22%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1559476%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

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"
}
]
}

0 Replies