I have been attempting to format the colour of each row via the date in my $CONTRACTEXPIRES column.
I have the formatting set successfully to be red if the date has passed and green if it has not.
Where there is no date entered into $CONTRACTEXPIRES it is red and I require this to remain grey/none formatted if possible. I have scoured a lot of sites in order to attempt this, but they all refer to column formatting, not the row.
My current code:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
"additionalRowClass": {
"operator": ":",
"operands": [
{
"operator": "<",
"operands": [
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
{
"operator": "Date()",
"operands": [
"[$CONTRACTEXPIRES]"
]
}
]
}
]
},
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
{
"operator": "Date()",
"operands": [
"@now"
]
}
]
}
]
}
]
},
"sp-css-backgroundColor-BgCoral sp-css-color-CoralFont",
{
"operator": ":",
"operands": [
{
"operator": ">",
"operands": [
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
{
"operator": "Date()",
"operands": [
"[$CONTRACTEXPIRES]"
]
}
]
}
]
},
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
{
"operator": "Date()",
"operands": [
"@now"
]
}
]
}
]
}
]
},
"sp-css-backgroundColor-BgMintGreen sp-css-color-MintGreenFont",
""
]
}
]
}
}
$CONTRACTEXPIRES
column? Date and Time or Single line of text?