Use cases → Scheduling
Automatically colour-code calendar events by rule
Apply consistent event colours for categories like external meetings or focus time by using a delegated service account to update users’ calendars.
| Who it is for | IT automation teams managing user productivity and calendar hygiene across a domain. |
|---|---|
| APIs | Calendar API |
| Typical scopes | calendar |
The problem
Manual event colour-coding is inconsistent and unreliable at scale. Users miss patterns, and visual clutter makes it hard to spot key events or conflicts. Central automation is needed, but must not disrupt user edits.
How it works
- Grant the service account domain-wide delegation with calendar scope.
- Scan each user's primary calendar for new or updated events matching your rules.
- Apply the desired colourId to qualifying events using the Calendar API’s patch method.
- Store a marker (e.g., in the event description or extendedProperties) to track processed events and avoid repeat changes.
What changes
Events get colour-coded automatically and consistently, making calendars more readable without burdening users.
Watch it explained
“Google Sheets - Use Apps Script to Create Google Calendar Events Automatically” — Eamonn Cottrell on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.
Questions people ask
Can I use this with shared calendars?
Yes, but you must ensure the service account has access—domain delegation only covers users in the domain, not external shared calendars.
How do I avoid undoing user changes?
Always fetch the latest event just before patching, and only update the colourId or your own marker fields, leaving other fields untouched.
Want this built?
This is a pattern we run in production. We will set up the delegation and build this on top of it — $500 per hour, most of it working the same day.
Talk to us Or read the setup guideRelated use cases
Build a real picture of team availability
Read calendars across the domain to answer who is free, who is overloaded and where the week actually went.
Turn a finished meeting into follow-up automatically
Detect that a meeting happened, pull the notes, and draft the follow-up before anyone opens their laptop.
Turn a booking into a record everywhere it matters
When a meeting is booked, create the record, the folder and the confirmation in one pass.