What We're Doing

Wouldn't it be wonderful to use a Google Form for Calendar event registration? As it stands, we can use the Form to collect responses, but we're stuck manually adding respondents to our event, a process that can quickly consume our working time. This script aims to change that!

The script attaches to a Google Form's Response Google Sheet and automates adding respondents as Guests to the Google Calendar event. Since we're using a script, we can use logic to conditionally add Guests based on their answer to a Form question (one option is built in and others can be added).

Now, the process for setting this up isn't a 5-minute thing... yet. The first setup is the trickiest. You'll have a few settings to change and a bit of code to learn. Once you've set it up and are more familiar with the process, you'll be able to implement this script on a Google Form in just a few minutes. Ready to get started?

Note: The Calendar event invitation emails come from whichever account sets this script up, so be sure you're logged into the correct account.

1. Enable the API

The following steps only need to be performed once per Google account. Once you've changed this setting, you can add this script to any Form Responses Google Sheet.

  1. Go to the Events: insert API by clicking this link.

  2. Check that the calendarId is set to primary and sendUpdates is set to all:

    Untitled

  3. In the Request body section, update the [email protected] line to your username+test@server.domain (e.g., [email protected]). When done, click Execute.

    Untitled

    You'll receive an email in your Inbox:

    Untitled

2. Open the Form Responses Google Sheet’s Apps Script editor

  1. In the response Sheet, click Extensions menu > Apps Script. The Apps Script editor will open in a new tab.

  2. Delete the auto-generated code in the Code.gs file:

    Untitled

  3. At the top, click on Untitled project and give your script a name.

  4. Save your changes.

3. Ensure the script is a default GCP Cloud Platform project

  1. In your script, click the Project Settings option on the far left.

    Untitled

  2. On that page, check that the GCP Project is set to Default.

    Untitled

4. Add the Google Calendar API service