Google Calendar Events via Google Form

This script allows you to setup a Google Form that adds events to a calendar. It’s useful.

You’d make your form first and calendar. Then you’d adjust it to reflect your particular column order and calendar ID. Finally, you’d add the script to your Google sheet (where the form submissions end up).

[Edit]

You’ll also want to set your script trigger to run on the submission of the form.

screen-shot-2016-09-08-at-8-37-40-pm
While in script editor, you’ll see a little clock icon. Click it and add the trigger so that the function runs on form submission.

screen-shot-2016-09-08-at-8-38-03-pm

That’s about it.

Comments on this post

  1. Jeff Everhart said on November 3, 2015 at 3:09 pm

    Any reason you don’t just tap into the form submit event array? https://developers.google.com/apps-script/guides/triggers/events

    It could pretty much entirely cut out the getLatest parts of that function. Since the form submit event returns an array, zero indexing would apply. Here is an ex from a post I’ve been working on. Looking to make a tutorial vid in the next few days:

    http://www.jeffreyeverhart.com/2015/11/03/how-to-create-a-google-calendar-event-with-google-forms/

    You’re doing some cool stuff with Google apps 🙂 I’ll be back! Cheers!

    • Tom Woodward said on November 3, 2015 at 3:17 pm

      I blame it on ignorance. 🙂

      Thanks for the tip and so very happy to see the post.

  2. Johan Horak said on March 18, 2016 at 8:23 am

    Hi

    I want to create a form that will update x number of calendars depending on the x selected when the form is submitted.

    I can use the old FormMule script but not sure if it can send events to different calendars.

    • Tom Woodward said on March 18, 2016 at 1:57 pm

      Johan – That should be possible. I think just push the various calendar IDs into an array (based on the form choices) and loop the event creation piece for each calendar ID.

      I’m at a conference at the moment but I’ll make a demo in the next week or so.

      • Johan said on March 18, 2016 at 11:42 pm

        Thanks for commenting Tom. Appreciated. I am looking forward to the demo if you have the time. BTW: I think I can do the first bit but not sure about the last “looping the event” 🙂

        • Tom Woodward said on March 22, 2016 at 11:13 am

          Here’s the loop for adding to multiple calendars. You’d just work it in with the create event portion and map fromSS to the form entry that allows users to pick the calendars. I’ll probably rewrite an example that takes advantage of the simpler version Jeff created and adding this element. That’ll probably happen this weekend at the latest.

  3. Sebastian said on March 23, 2016 at 9:23 am

    Hey Tom,

    Thanks for posting this. I have a question: What adjustments would I have to make if I wanted to schedule the event for a specific time instead of for specific dates? Example: Monday, July 25th from 1 pm to 4 pm.

    Would appreciate your help on this.

    Best,
    Sebastian

    • Tom Woodward said on March 23, 2016 at 9:34 am

      Pretty sure this one will do that. You just have to activate the time option in the form date field. If it doesn’t (and maybe you should anyway) take a look at the script Jeff references above.

  4. Eric said on March 23, 2016 at 10:22 am

    Thanks for the great information! Not sure if my previous comment posted so I’ll try again.

    Hopefully you can help me with a couple of questions. I almost have what I need but I can’t seem to figure out two details: (1) I would like to make it so that there is a default end date/time (always two hours later than the start date/time) built into the script and therefore NOT entered manually at all because (2) I would also like to add recurring events with two specific options–a one-time event and another option that allows me to repeat the event 12 times. Does that make sense?

    Is this something you would be able to provide some suggestions with? I haven’t had any luck in my efforts up to now and with only limited programming experience.

    Thanks,

    Eric

    • Tom Woodward said on May 22, 2016 at 10:49 am

      Sorry Eric. Your comment got caught in the spam folder . . . which I need to check more regularly.

      As penance, I’ll try to write a decent post about this in the near future. In the meantime . . .

      1. You could create an auto-end time in the script itself by doing something like (pseudo code- obviously)
      var endTime = startTime+2;

      2. You could make the initial question something like ‘is this a one time or repeat?’ If they choose repeat, you’d set the variable in the script to 12 if (column A = 'repeat') { var repeat = 12} else {var repeat = 1}
      Then you’d loop through the event creation 12 times incrementing the date variable in whatever way you needed.

      Tom

  5. jeff yeage said on September 8, 2016 at 4:33 pm

    I am completely new at this,

    I am experiencing an issue wherein when I submit the form, the information is recorded in my google worksheet,

    however.. unless I open the script editor and run the script the script doesnt function..

    I am sure I am missing something? just not sure what.

    • Tom Woodward said on September 8, 2016 at 7:40 pm

      Yep – you want to set the script trigger to fire on form submission. I did not have that in the directions. I’ve amended them.

Leave a Reply

Trackbacks and Pingbacks on this post

No trackbacks.

TrackBack URL