Google calendars synchronization

Kirill Grishchuk
3 min readNov 5, 2021

--

Problem

You have two calendars

  • personal
  • work

You need to sync time-slots in order to setup meetings in available time, currently there is no feature to add one google calendar to other without default event visibility, so I decided to create my own script in “Google Apps Script”.

Requirements

  1. Both of your calendars are google.
  2. Install Google Apps Script app into your target(work) account link
  3. Shared personal calendar to work account

Setup guide

  1. Install Google Apps Script app into your target(work) account link

2. Share your personal calendar to your work calendar via UI.

press “Settings and sharing” and after add your work account to share with specific people.

3. Create new Google Apps Script app in your work account link

4. Copy content of src.js into newly created project file.

src.js is a file in github repo

5. Change id variable to your personal email, where you shared calendar from. For example: DO NOT FOREGET TO SAVE CHANGES WITH cmd/ctrl+S, or save button.

var id = "kirya522@gmail.com"; // CHANGE - id of the secondary calendar to pull events from

6. Configure trigger to update your calendar. Click on timer icon on the left.

7. Click add trigger on the right bottom side and configure trigger to execute sync function each minute.

And press save.

As a result events from you personal calendar will appear in work calendar with no description

Sample synchronization result

That is it.

Events from your personal calendar will sync each minute to your working calendar with specific name, you can change it using variable SYNC_EVENT_NAME

Default configuration sync to next 30 days you can change it too.

--

--

Kirill Grishchuk
Kirill Grishchuk

No responses yet