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.
- The script runs automatically on a fixed schedule using Apps Script's time-driven triggers.
GroupsAppservice is used to determine the members of the team's Google Group.
- The Advanced Calendar Service provides access to the Calendar API and the ability to search for events on your colleague's calendar.
First, set up Google Calendar:
- Open Google Calendar in your browser.
- Create a new calendar called "Team Vacations".
- Still in the settings screen, select the new calendar from the left menu.
- Scroll to Integrate calendar and copy the value under Calendar ID.
Next, create the Apps Script project:
- Open the Apps Script project in your browser.
- Click the menu item File > Make a copy....
- Set the variable
TEAM_CALENDAR_IDto the ID of the calendar you created earlier.
- Set the variable
GROUP_EMAILto the email address of a Google Group containing your team members.
Then run the script:
- Click the Select function dropdown and select setup.
- Click the Run button (►).
- When prompted, click the Review permissions button.
- Select your G Suite account from the list.
- 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.
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.