Members-only tutorial
Watch the video and get the practice sheet with membership.
About this Tutorial
Sheet Resources
Video Transcript
<div>0:00 Hi, so in this video I'm going to show you how to send an email when a Google form Learn about Google Forms and how to create effective forms for data collection. Opens in new tab is filled out with the Form entries now you might be thinking oh, I already do that I get an email from Google It tells me I have filled out a form and or someone has filled out a form and that is true But I want to make<br>0:16 that email a little bit better, so if we go up to Tools, create a new form And we're going to create a new form, and we're just going to say it's some kind of like Entry for people to sign up for some event right so we'll have some short answers Understand how to manage and interpret responses from your forms. Opens in new tab We'll have a name, and we'll have let's make another thing<br>0:38 and say occupation Okay, so that's two items.
We can add more and more if we want and actually it does not matter How many items there are we can get them all with the code that I'm going to show you okay, so in settings you can Do something where Explore how to filter data using the WHERE clause in queries. Opens in new tab you get out here responses?<br>0:58 You can say hey email me Get email notifications Find out how to set up email notifications for form responses. Opens in new tab all right. Let's go look at what that looks like so I filled out the form and here It says one response it says Your form has a new response and in order to see What is in there?<br>1:15 I have to go to this which I have to go to responses and be like okay?
There's one response response great actually just hi hi let me do again another one another one occupation doctor submit and now I have this and it looks fine if it's only one or two or three but when it gets more and more this is<br>1:38 going to be very very hard to look through and see individual people I have to click through these one through two maybe 200 I want them in my inbox and I want them in a nice like table Discover how to create and format tables for better data presentation. Opens in new tab so what I have done in Apps Script Get introduced to Google Apps Script for automating tasks in Google Workspace. Opens in new tab is already wrote this function Learn about functions in Google Sheets and how to use them effectively. Opens in new tab for you so you can copy this sheet you can copy this<br>2:02 uh code I'll put it up at apps uh better sheets.co slash snippets as well and what it does we'll walk through it is first it is a named function Understand what named functions are and how to create them in Sheets. Opens in new tab which we'll deal with how to trigger Explore triggers in Google Apps Script to automate your workflows. Opens in new tab this later uhm but we'll we get the form values Learn about values in Google Sheets and how to manipulate them. Opens in new tab we create a table Discover how to create and format tables for better data presentation. Opens in new tab in html and for every single value we get both the key<br>2:25 and the data Understand data types and how to work with data in Google Sheets. Opens in new tab which means the question and the answer and then we build a table and we send an email with a subject form submitted with a date so that we can do this multiple times during the same day we are sending an email to to the owner of this spreadsheet we can enter any email we want and actually<br>2:44 this is one of the most important parts of this is that you can set this particular email who it's to to a number of individuals at your company, business, or yourself and an assistant or just the assistant you can edit this sheet owner email and then we have use mail app here.<br>3:01 We can also use gmail app but right now we're just going to use mail app.
Okay, how do we trigger Explore triggers in Google Apps Script to automate your workflows. Opens in new tab this?<br>3:07 How does um this trigger Explore triggers in Google Apps Script to automate your workflows. Opens in new tab that? Well, we're gonna first not get the email notifications Find out how to set up email notifications for form responses. Opens in new tab of new responses. We're gonna cut that off and then once we're save this, we're going to go over here to triggers on the left.<br>3:25 We're gonna create a new trigger Explore triggers in Google Apps Script to automate your workflows. Opens in new tab and I'm gonna choose which function Learn about functions in Google Sheets and how to use them effectively. Opens in new tab to run. If you have other functions Get familiar with various functions available in Google Sheets. Opens in new tab , you'll have to select Learn how to use the SELECT clause in queries to retrieve specific data. Opens in new tab it from here and we are going to save event source from spreadsheet Discover the basics of spreadsheets and how to navigate them. Opens in new tab and event type on form submit.<br>3:37 That is it. Save that. And we'll have to authorize it.
But once it's saved, let's let's fill out this this again.<br>3:49 Let's submit another response and let's see what happens. Let's call hello and doctor again. Submit. So let's see Let's go look at our email.<br>4:01 And this is the email we got. It says form submitted and it has a time stamp of when that form was submitted, name, and the occupation.<br>4:09 So all of the information from that form is right here in our inbox. This is fantastic. I do not have to go back to our form responses here and check what's going on.<br>4:20 What is the data Understand data types and how to work with data in Google Sheets. Opens in new tab ?
I do not have to look through this summary, these responses, these questions. It's all in one package in my inbox so I can search through it.<br>4:30 Maybe you want to put a keyword in the subject. Maybe you want to put some other information here. For instance, we may want the URL of this email.<br>4:40 The sheet. So let's add that actually in this video. So here we have this HTML. We're going to add another line HTML plus equals and we are going to say uhm sheet URL.<br>4:58 and actually we want to write a little bit of HTML here.
We're just going to do P and then this plus sheet and then at the end plus and in quotes again and in quotes again we're going to end that P.<br>5:22 So that's just a little bit of HTML, paragraph, um we're going to write sheet and then put the sheet URL here.<br>5:28 What's the sheet URL? Let's get it. Variable sheet URL equals. I think we can just grab this instead of retyping it.<br>5:37 Get sheet. Hmm. Let's actually get active sheet Understand what the active sheet is and how to reference it in scripts. Opens in new tab . Get sheet. Ah, what it is, is get. Get active spreadsheet Learn about the active spreadsheet and how to work with it in Apps Script. Opens in new tab . Get active.<br>6:00 URL. There it is. Not sheet URL. Get URL.
And so this sheet URL will be in the email. Let's save this and go submit another response and check.<br>6:11 So we go, howdy, yo. And here we go. We're done. We're going to see if this shows up. We have a new email and now we have the sheet that it's selected.<br>6:25 So we have the actual sheet that we can get to immediately if we want any more information here. And I want to show you that this is, this code doesn't need to be edited if you want to add more things.<br>6:35 So let's add a few more items, a few more questions. Let's add a question, how are you today?
We can even say okay, add option, good.<br>6:52 Okay, let's go to the sheet form rather let's say you're name is hula boy, how are you doing? Okay, occupation, hulaing, submit.<br>7:10 And already we have the email, we have the name, the time stamp, the occupation, are you okay, and the sheet. So we did not have to edit the code.<br>7:20 Even if we added more items to the form, which makes this really, really flexible and very, very easy. So here we see all these.
So this adds another function Learn about functions in Google Sheets and how to use them effectively. Opens in new tab , another option for you, instead of these uh response emails.<br>7:35 Up here, get email notifications Find out how to set up email notifications for form responses. Opens in new tab for new responses. You can also have that if you want, but I like this much better.<br>7:40 It is much more flexible. We can add more HTML to this, more styling if we want. Uh you can add more things like the sheet, add more items easily, all types of stuff.<br>7:51 I hope this makes sending emails when your form is filled out much, much easier for you and much better for you.</div>