Google Calendar Events via Google Form
- Author: Tom Woodward
- Category: Google
- Tags: calendar, google form, google script
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.
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.
That’s about it.
Related posts
WP JSON to Google Sheets – Reflective Data
Image from page 86 of “Refraction and motility of the eye, with chapters on color blindness and the field of vision” (1920) flickr photo by Internet Archive Book Images shared with no copyright restriction (Flickr Commons) Way back in 2015, I wrote a little pluginand a blog post or I’d never be able to find it to count URLs, get the word count and do other stuff so I could reflect on my blog posts. Given some (k)new knowledgeKickin’ the new k-nowledge . . . an MC to a degree that you can’t get in college, I figured I could make a version that runs in Google Sheets and indeed I can. The reason I like this as an alternative to the plugin is that it works for anyone who has access to Google Sheets even if they can’t install plugins. Google Sheets also offers a lower barrier to messing with your own data once you get start capturing it. You can count the !s, or a variety of emoticons, or how often you use the word “spaces,” or whatever you want- all without the ability to program in php or javascript. I think it starts to open up different doors for studentsand other humans to gather their own kind of data for reflection and amusement. It starts to get […]
- Author: Tom Woodward
- Category: Data, Google, WordPress
- Tags: google scripts, google sheets, json api, rest api
Parallel Practice Logging in Google Forms/Sheets
The goal of this project was to have students logging their practice on translation and a separate non-translation activity.Jogging, juggling, some other j word . . . It’s a neat idea and I proposed doing it via Google Forms/sheets because it was a really short timeline. Here’s a walkthrough of how it ended up with version two. It’s likely we’ll have a more packaged third version that will integrate some more elements. There’s not too much unique going on in the script but here are a few of the hassles and how I dealt with them. Connect Weekly Data for Stacked Bar Chart I needed a way to group the data logged per week. ISOWEEKNUM gives you the week number that a particular date occurs in. So this little bit sets the last row of column N to be the ISOWEEKNUM function and referneces the date the form was submitted. This is handy and I’d never run across it before. Keep it Sorted I was trying to figure out how to do the sorting on the QUERY but this seemed easier. This function just keeps the entire sheet ordered by the week number. That way if people enter data later, it doesn’t mess up the graph. Authorizing IMPORTRANGE via Script From the beautiful people at Stackoverflow comes this gem. Previously, […]
- Author: Tom Woodward
- Category: Google, Workflow
- Tags: Google Forms, google scripts, google sheet
Google Script – Plain Text
Google Sheets often thinks it’s smarter than you. That’s helpful at times and irritating at other times.Mostly, I find it irritating. The Google Form to Sheets path is one place where that can come up repeatedly and in ways that are hard to see. For instance, if you use the Time entry on forms, Google Sheets tries to coerce it into a date structure while leaving you seeing just the time in the sheets view. That leads to weird and unpredictable stuff if you’re trying to use Google Scripts to interact with that cell data based on what you see. For instance, this is data from the time entry field as seen on the sheet side. Note the two places you might expect to see truth. Now if we get that same data via Google Script . . . Cell data that you’d expect to just be that time element returns as Sat Dec 30 1899. The time is right though. If you manually change the format of that column to plain text things work . . . but it gets re-set on all subsequent submissions. My solution so far has been the following Google Script set to fire on every new form submission. In my case, I’m changing the format of the latest entry in the spreadsheet in columns […]
- Author: Tom Woodward
- Category: Google
- Tags: google form, google script, google sheets
Comments on this post
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!
I blame it on ignorance. 🙂
Thanks for the tip and so very happy to see the post.
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.
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.
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” 🙂
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.
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
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.
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
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
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.
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.
Just wanted to say thank you for the code and the clear explanation. Automated vehicle submission thanks to you at my non-profit. Appreciate it.
Awesome!