sync-multiple-google-calendars
sync-multiple-google-calendars copied to clipboard
Sync Multiple Google Calendars into One
Sync Multiple Google Calendars into One
When you want to sync multiple Google Calendars into one. Currently Google Calendar doesn't have this option and IFTTT/Zapier don't allow an easy way to do this.
This is useful for a collective Busy/Free Calendar or Google Home integration.
Getting Starting
-
Make sure every calendar you want sync is shared with the account that holds the shared calendar.
-
Log into the account that holds the shared calendar and go to the Google Apps Scripts website.
-
Click on "New Project".
-
Replace everything in
Code.gs
with the contents of SyncCalendarsIntoOne.gs. -
Create a new script file called
BatchRequests.gs
with the contents of BatchRequests.gs -
Update
calendarsToMerge
,calendarToMergeInto
,SYNC_DAYS_IN_PAST
, andSYNC_DAYS_IN_FUTURE
variables. Be sure to save. -
Click the
Project Settings
Gear icon on the left panel. Check theShow "appsscript.json" manifest file in editor
. Go back to code editor on the left, and update its content with appsscript.json. -
Click
Run
. This will load theAuthorization required
window since it's your first time running the script. Click onReview permissions
and give it permission to your account. -
Click on
Triggers
clock icon on the left panel to add a trigger. Click onAdd Trigger
.-
You have two choices, "Time-driven" or "From calendar".
-
Time-driven will run every X minutes/hours/etc. Use this if you have calendars that update frequently (more than 5-10 times in a 15 minute timespan)
-
"From calendar" will run when a given calendar updates. Use this if you want instant merging.
a. Time-driven
- "Choose which function to run":
SyncCalendarsIntoOne
- "Choose which deployment should run":
Head
- "Select event source":
Time-driven
- "Select type of time based trigger": choose what works for you.
- Click "Save"
b. From calendar
- "Choose which function to run":
SyncCalendarsIntoOne
- "Choose which deployment should run":
Head
- "Select event source":
From calendar
- "Enter calendar details": enter one of the calendars you are merging from.
- Click "Save"
- Repeat these steps for every calendar you're merging from.
- "Choose which function to run":
-
-
Enjoy!
Notes
- Google App Scripts has a daily quote of 5k events created per day. See Quotas for Google Services
- Be sure to turn off "notifications".
Icon Attributions
event favorite, event unknown, and event warning by arjuazka from the Noun Project Merge by Travis Avery from the Noun Project
License
MIT © Ali Karbassi