We've got a few teams sharing one out of office calendar. Rebuilt it on modern SharePoint Online since the old one was a classic Calendar list and classic is going away.
Problem with everyone in one calendar is you get 15 entries on a Tuesday and no idea which ones matter to you. So I wanted each team's events in their own color.
Approach is straightforward enough. Flow writes a CSS class into a text column when a request gets approved, view formatting JSON reads that column:
{
"schema": "https://developer.microsoft.com/json-schemas/sp/v2/view-formatting.schema.json",
"additionalRowClass": "=[$EventColorClass]"
}
Calendar rendered fine. Every event grey. No color at all.
And this is the annoying part, everything looked right. Opened the list, column had sp-css-backgroundColor-BgCyan sitting in it exactly like it should. JSON editor accepted it, saved, no complaints. Reloaded the calendar. Grey.
No error message. Nothing in the JSON editor. Nothing on the page. It just doesn't do the thing and doesn't tell you why.
So I assumed the JSON was wrong. Rewrote it a few times. Tried additionalEventClass instead of additionalRowClass. Hardcoded a class directly to rule out the column reference, still grey, which really threw me because at that point there's no column involved at all.
The actual cause: the column you reference has to be a shown column in that view. Edit view columns, tick the box next to it, done. Colors immediately.
Which is counterintuitive because the column is never displayed. It holds a CSS class, not something a person reads. But if it isn't in the view's shown list, the formatter can't resolve [$EventColorClass] and quietly renders nothing rather than telling you the reference is dead.
So two settings, two different panels, and neither one mentions the other exists.
Other stuff I ran into after that:
- Per view. Getting Month working doesn't get you Week.
- Only classes SharePoint actually ships will render. Made up ones fail the same silent way.
- Some names aren't what you'd expect. Rose is BgDustRose, Mint is BgMintGreen.
- The choice pill formatter in list views uses different classes than the calendar does for the same color name. Cyan is BgCornflowerBlue as a pill but BgCyan on the calendar. Spent a bit of time confused by that one.
If a flow is writing the class, look at the column before you touch the JSON. I lost most of an afternoon debugging a formatter that was working fine.