The code didn't work unfortunately.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"background-color": "=if(indexOf('[$Lookuptrngcrstitle.Title]', @currentField) == -1, 'red', '')"
},
"children": [
{
"elmType": "span",
"txtContent": "@currentField"
}
]
}
All title field values appear as red backgrounds. I've checked and the internal name for the lookup column is Lookuptrngcrstitle I later edited it to become Lookup trng crs title, neither of these have worked:
"background-color": "=if(indexOf('[$Lookup trng crs title]', @currentField) == -1, 'red', '')"
"background-color": "=if(indexOf('[$Lookup trng crs title].Title', @currentField) == -1, 'red', '')"
both versions of the logic above make the Title column red background
"background-color": "=if(indexOf('[$Lookup trng crs title]'.Title, @currentField) == -1, 'red', '')"
logic above makes the Title column appear blank.
There is probably a (more complex) solution using Flow and an extra column in the calendar. The flow would check for a match and set a new match column as true/false, the colour of the Title field could be determined by that.