Close Google Form At Specific Time in Google Sheets
Learn how to automatically close a Google Form at a specific time using Google Sheets and Apps Script. This tutorial walks you through the steps to set up a function and trigger for seamless form management.
So you want to close your Google form at a specific time. We're taking attendees. We're asking people to submit maybe some lottery tickets or coupons or anything. We want a form to be open, but we want to close it at a very specific time and we don't want to have to come to this form again and close forms . I'm going to show you how to automate this in Apps Script from a sheet.
Go to extensions, Apps Script . That's going to open this editor here. We're going to write a function , and then we're going to create the trigger .
So let's rename this sheet and call it attendees. Let's make sure the capitalization is correct. Yeah. All caps and get form URL . So this is a special little function , get form URL that if a sheet or a tab has a form connected to it, we'll get the URL there of that form, not the URL of the sheet.
If we wrote true, that would be opening it up. But false means we're going to close it or not accept any responses anymore. Save. You can click the save button here, command, save, control, save anything you want.
Click save. But how do we trigger this? Over on the left side is triggers. So let's go there. We're going to create a trigger on the bottom right, add trigger .
m. So if it was like 9 p. m., 09 is 9 a. m., but 21 is 9 p. m. Let's say we want it closed at 11 a. m. Click save. When you click save, if you haven't run this function before or tested it out or anything, you'll have to authorize at that point.