This Google Apps Script automates the handoff process by:
- Detecting new calendar events.
- Creating a shared Google Drive folder for handoff.
- Sending a Google Form to a participant.
- Storing form responses as a PDF in the shared folder.
- Notifying participants via email.
β
Detects new events with at least two participants.
β
Creates a Google Drive folder for the handoff.
β
Sends a Google Form to a participant for details.
β
Converts form responses into a PDF.
β
Stores the PDF in the shared folder.
β
Notifies participants via email.
- Open Google Apps Script.
- Create a new project.
- Copy and paste the script into the editor.
- In Apps Script Editor, go to:
- Services > Enable Google Drive API
- Services > Enable Google Calendar API
-
Calendar Event Trigger
- In Triggers > Add a trigger for
onCalendarEventCreated
- Choose Event Source β
From Calendar
- Choose Event Type β
On event creation
- Set Calendar ID (your Google account email).
- In Triggers > Add a trigger for
-
Form Submission Trigger
- In Triggers > Add a trigger for
onFormSubmit
- Choose Event Source β
From form
- Choose Event Type β
On form submit
.
- In Triggers > Add a trigger for
-
Calendar Event Created
- Detects new event with at least 2 attendees.
- Creates a Google Drive folder for the handoff.
- Shares the folder with Participant A.
- Sends a Google Form to Participant B.
-
Participant B Submits the Form
- Captures form responses.
- Converts responses into a PDF.
- Saves the PDF inside the shared folder.
- Sends an email to both participants with the folder link.
- Participant A gets access to the shared folder.
- Participant B receives the form.
- Once the form is submitted, both get an email with the handoff details and folder link.
- Logs errors in Apps Script Logs (
Logger.log()
). - Skips event processing if:
- There are fewer than 2 participants.
- Form responses are missing.
- Google Drive folder cannot be created.
- Ensures duplicate triggers are not created.
- Google Apps Script: script.google.com
- Google Drive: drive.google.com
- Google Calendar: calendar.google.com