How To Create A Shared Calendar In Gmail
Coding level: Beginner
Duration: 15 min
Project type: Automation with a time-based trigger
About this solution
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. This solution lets you quickly see when your colleagues are out of the office, with no manual entry required.
How it works
This solution populates a shared vacation calendar based on the individual calendars of each person in a Google Group. When someone books time off they just need to add an event to their personal Google Calendar using a keyword like "Vacation" or "Out of office."
Every hour, the script scans the calendars of all the members in a Google Group and syncs appropriate events to the shared calendar. You can change how often the script scans for new events.
Apps Script services
This solution uses the following services:
- Groups Service: Determines the members of the team's Google Group.
- Advanced Calendar Service: Provides access to the Calendar API and searches for events on your colleagues' calendars.
Before you begin
To use this sample, you need the following prerequisites:
- A Google Workspace account (you might need administrator approval)
- A web browser with access to the internet
Try it
Step one: Set up Google Calendar
- Open Google Calendar.
- Create a new calendar called "Team Vacations."
- In the new calendar's settings, under Integrate calendar, copy the Calendar ID.
Step two: Create the Apps Script project
- Open the Vacation Calendar Apps Script project.
Open the project - Click Overview > Make a copy .
- Set the variable
TEAM_CALENDAR_ID
to the ID of the calendar you created earlier. - Set the variable
GROUP_EMAIL
to the email address of a Google Group containing your team members.
Step three: Run the script
- In the function dropdown, select setup.
- Click Run.
- When prompted, click Review permissions and authorize the script.
- When complete, return to Google Calendar to confirm the Team Vacations calendar is populated with events.
Review the code
In the Apps Script project, review the comments in the Code.gs file to learn more about how the script works.
Modifications
You can edit the team vacation calendar automation as much as you'd like to fit your needs. Below is an optional change to modify the trigger.
Change how often the script scans for new events
To change how often the script runs, take the following steps:
- In the Apps Script project, click Triggers .
- Next to the trigger, click Edit Trigger .
- Select your changes and click Save.
Contributors
This sample is maintained by Google with the help of Google Developer Experts.
How To Create A Shared Calendar In Gmail
Source: https://developers.google.com/apps-script/samples/automations/vacation-calendar
Posted by: burtonegary1949.blogspot.com
0 Response to "How To Create A Shared Calendar In Gmail"
Post a Comment