I would like to nest if conditions into SharePoint via JSON column format.
I have two fields, Date and Status. The status field contains 3 strings ("Done", "Pending", "New")
Example:
if ([$Date] < @NOW) {
if([$Status] == "Done") {
font color GREEN
} else {
font color RED
}
} elseif ([$Date] == @NOW) {
if([$Status] == "Job done") {
font color GREEN
} else {
font color RED
}
} else {
font color black;
}
And my Json code so far... (Only the first condition)
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"color": "=if([$DeadLine] <= @now + 86400000, '#FAFAFA', '#22ff00')"
}
}