Automatically populate a team vacation calendar

Quickly see when your colleagues are out of the office, with no manual entry required.

Last updated: August, 2019

A shared vacation calendar is a great tool for helping your team collaborate; anyone can determine who's out of the office at a glance. However, booking time off is already a chore, and an additional step to update the calendar can be easy to forget.

This solution uses Google Apps Script to automatically populate a shared vacation calendar based on the individual calendars of each person on the team. When someone books time off they just need to remember to add an event to their personal Google Calendar using a keyword like "Vacation" or "Out of office." The script acts behind the scenes, scanning the calendars of all the members in a Google Group and syncing appropriate events to the shared calendar.

Note: This solution only accesses Calendar events that your colleagues have made visible to you via their privacy settings.


Technology highlights

Try it

First, set up Google Calendar:

  1. Open Google Calendar in your browser.
  2. Create a new calendar called "Team Vacations."
  3. Still in the settings screen, select the new calendar from the left menu.
  4. Scroll to Integrate calendar and copy the value under Calendar ID.

Next, create the Apps Script project:

  1. Open the Apps Script project in your browser.
  2. Click the menu item File > Make a copy....
  3. Set the variable TEAM_CALENDAR_ID to the ID of the calendar you created earlier.
  4. Set the variable GROUP_EMAIL to the email address of a Google Group containing your team members.

Then run the script:

  1. Click the Select function dropdown and select setup.
  2. Click the Run button (►).
  3. When prompted, click the Review permissions button.
  4. Select your Google Workspace account from the list.
  5. Click the Allow button.

When complete, return to Google Calendar to see the Team Vacations calendar populated with events. For a more detailed record of what the script did, you can view the logs by clicking View > Stackdriver Logging and then Apps Script Dashboard.

Next steps

To get started with Google Apps Script, try out the codelab which guides you through the creation of your first script.

You can also view the full source code of this solution on GitHub to learn more about how it was built.


Were you able to get the solution up and running?

If you have an idea for another solution you'd like to see featured in our gallery submit a request on the GitHub issue tracker.