Automatically Email if Google Form Submitted

Learn how to enhance your Google Form submissions by automatically sending customized emails with the form responses using Google Apps Script. This tutorial walks you through the process of setting up the script and triggers for a more efficient email notification system.

So in this video, I'm going to show you how to send an email when a Google form 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, or someone has filled out a form. And that is true, but I want to make that email a little bit better. 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. So we'll have some short answers , we'll have a name, and we'll have let's make another thing 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 you get, oh here, responses. Send Better Email When Google Form Filled Out How to Send Google Forms Entries Automatically with Apps Script Send Better Email When Google Form Filled Out Create a Google Form for Emails Only

You can say, hey, email me, get email notifications . Alright, 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, I have to go to this, which I have to go to responses and be like, okay, there's one response. Great. Actually, just hi hi. Let me do again 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 going to be very hard to look through and see individual people I have to look through Click through these one through two, maybe 200. I want them in my inbox and I want them in a nice. So what I have done in Apps Script is already wrote this function for you.

So you can copy this sheet. You can copy this 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 , which We'll deal with how to trigger this later, but we'll get the form values . We create a table in HTML and for every single value, we get both the key and the data , which means the question and the answer. And then we build a table and we send an email with the subject form submitted. With a date so that we can do this multiple times during the same day. We are sending an email to the owner of this spreadsheet . We can enter any email we want. And actually this is one of the most important parts of this is that you can set this particular email, who it's to a number of individuals at your company, business, or.

Or yourself and an assistant or just the assistant, you can edit this sheet owner email. And then we use mail app here. We can also use Gmail app, but right now we're just going to use mail app. Okay. How do we trigger this? How does this trigger that? We're going to first not get the email notifications of new responses. We're going to cut that off. And then once we save this. We're going to go over here to Triggers on the left. We're going to create a new trigger . And I'm going to choose which function to run. If you have other functions , you'll have to select it from here. And we are going to save Event Source from Spreadsheet and Event Type on Form Submit. That is it. Save that. And we'll have to authorize it. But once it's saved, let's fill out this again. Let's submit another response. And let's see what happens to call hello and doctor again. Submit. So let's go look at our email.

And this is the email we got. It says form submitted and has a timestamp of when that form was submitted, name, and the occupation. So all of the information from 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 is the data . 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 for it. Maybe you want to put a keyword in the subject. Maybe you want to put some, you know, other information here. For instance, we may want the URL of 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 sheet URL. 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. So that's just a little bit of HTML paragraph. We're going to write sheet and then put the sheet URL here. What's the sheet URL. Let's get it. Variable sheet URL equals. I think we can just grab this instead of retyping it. Get sheet, actually get active sheet , get sheet. Ah, what is get, get active spreadsheet , get 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. So we go, howdy, yo.

And here we go. We're going to see if this shows up. We have a new email. Email. And now we have the sheet that it's selected. 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. 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. Okay. Let's go to the sheet form. Rather, let's say your name is. Hula boy, how are you doing? Okay, occupation hula, submit. And already we have the email. We have the name, the timestamp , the occupation, are you okay? And the sheet. So we did not have to edit the code even if we added more items to the form, which makes this really flexible and very easy. So here we see all these. So this adds another function , another option for you. Instead of these response emails. Up here, get email notifications for new responses. You can also have that if you want, but I like this much better. It is much more flexible. We can add more HTML to this, more styling. If we want, you can add more things like the sheet, add more items easily, all types of stuff. I hope this makes sending emails when your form is filled out much easier for you and much better for you.

Big Year 2027 calendar: the whole year on one Google Sheet

Free 2027 calendar.

Copy it to your Google Drive.

Free. No password, no card. The sheet link shows up right here.