How To Copy Tab For Each Google Form Submission

Learn how to automate the process of copying a tab in Google Sheets for each Google Form submission, including how to customize the tab with the submitter's name and a checklist.

In a previous video, I've created a tab for every single Google Form submission. We created the form, we created the Apps Script , and then we created the trigger . I'm going to go through that very quickly here, just in case you didn't see that other video. But in this video, we're going to not create a new tab, but actually copy a new tab. So we're When new employees get onboarded, we want to create a new tab for them, but we actually want to take this checklist , copy it, and put their name right here in B1, and then rename that sheet. So, I'm going to show you how to do that here. So far, it looks like this. We've created a function called newTab with an event e variable here that gathers all that information from the form. We get the full name from the form. This namedValues, fullName, is the literal name of the area

where they put in their full name. If you say name or fullName, Your name you're going to say that instead of full name here. We're going to create a date with utilities format date We're getting it from GMT 0 but you can change that to whatever your time zone is and then here is the line where we insert a sheet And we set the name to full name plus the date. So we need to edit this because we're not just inserting a sheet. Let's grab this name, cut it out here, call it name, uh, sheet name , equals this. So we're getting that full name and that date and we're just combining them. But this spreadsheet , We're getting GetSheetByName, it's going to be called Checklist with a capital C. And we're going to call this variable ChecklistEquals. And we're going to say Checklist .

copyTo. Where are we going to copy it? We're going to copy it to this exact spreadsheet , GetActiveSpreadsheet. Set name, sheet name . So now, instead of creating a brand new sheet that has blank cells , 26 columns, 1, 000 rows, we're going to copy Whatever this checklist is. And we also want to insert here B1. We want to find that. Well, let's actually make this a little easier to find. Instead of the date, we're not going to put the date in. We're just going to put their full name. Then we're going to Once we create it, spreadsheet , app dot, get active spreadsheet , get sheet by name is gonna be full name get range is gonna be B one. Set value.

Full name. Okay, let's see if all of this works together as promised, let's go and make sure we have a trigger created that triggers this add trigger . On the bottom right, choose which function to run. New tab, scroll down, and event type is on form. Submit. Save. And make sure we authorize it. Once we have that trigger here, let's go test it out. Hit submit. Go back to our sheet. We have Andrew K. And Andrew K is already filled in with this name. So our form, submitted, created the checklist , added the name, and set the name of the sheet here. Fantastic! If you're looking for more automations, Make sure you subscribe here to BetterSheets on YouTube. We're going to make your sheets work while you sleep.