How to Schedule your Google Forms and Limit Submissions

Written by Amit Agarwal on Nov 13, 2014

Google Forms impose no limits. Any poll or survey created inside Google Forms has no expiration date and it can collect unlimited number of responses until the form owner decides to manually close* the form.

For some Google Forms though, limits may be necessary. For instance, if you doing a contest or a giveaway on your website, you may only want to accept the first ‘n’ entries strictly on a first-come first-served basis. A teacher may want to open a form to students at a certain data and close it automatically at another date.

Google Forms - Schedule and Close Automatically

Set an Expiration Criteria for Google Forms

Google Scripts can help you easily schedule your Google Forms and they’ll automatically open and/or close at a certain data. Similarly, the script can be configured to turn off your form after a certain number of entries have been received through the form.

  1. Go to your Google Drive and open an existing Google Form or create a new form.
  2. Inside the Forms Editor, click Tools -> Script Editor and copy-paste the code snippet available below.
  3. While the Script Editor is open, go to File -> Project Settings and make sure that the correct time zone is selected.
  4. Set the RESPONSE_COUNT equal to the total number of entries that you would like to receive after which the form is closed automatically. If you would not like to set a limit, set this value to blank.
  5. Set the form’s open and close dates in lines #1 & #2 in  YYYY-MM-DD HH:MM format. If you would rather not have an open or close date, just set the corresponding value to blank.
  6. Press Ctrl+S (or Cmd+S on Mac) to save the script and choose Run -> Initialize to authorize the script.

The script will now run in the background and you’ll get an email notification when one of the conditions is met and the Google Form is closed for new responses.


Google Script for Scheduling Google Forms

FORM_OPEN_DATE   =  "2014-12-20 08:00";
FORM_CLOSE_DATE  =  "2014-12-25 23:30";
RESPONSE_COUNT   =  "100";

/* Web tutorial:  */

/* Initialize the form, setup time based triggers */
function Initialize() {
  if ((FORM_OPEN_DATE !== "") && 
      ((new Date()).getTime() < parseDate_(FORM_OPEN_DATE).getTime())) { 
  if (FORM_CLOSE_DATE !== "") { 
  if (RESPONSE_COUNT !== "") { 

/* Delete all existing Script Triggers */
function deleteTriggers_() {  
  var triggers = ScriptApp.getProjectTriggers();  
  for (var i in triggers) {

/* Send a mail to the form owner when the form status changes */
function informUser_(subject) {
  var formURL = FormApp.getActiveForm().getPublishedUrl();
  MailApp.sendEmail(Session.getActiveUser().getEmail(), subject, formURL);  

/* Allow Google Form to Accept Responses */
function openForm() {
  var form = FormApp.getActiveForm();
  informUser_("Your Google Form is now accepting responses");

/* Close the Google Form, Stop Accepting Reponses */
function closeForm() {  
  var form = FormApp.getActiveForm();
  informUser_("Your Google Form is no longer accepting responses");

/* If Total # of Form Responses >= Limit, Close Form */
function checkLimit() {
  if (FormApp.getActiveForm().getResponses().length >= RESPONSE_COUNT ) {

/* Parse the Date for creating Time-Based Triggers */
function parseDate_(d) {
  return new Date(d.substr(0,4), d.substr(5,2)-1, 
                  d.substr(8,2), d.substr(11,2), d.substr(14,2));

/* Written by Amit Agarwal */

Also see: Get Google Forms Data in an Email Message

[*] If you would like to close your Google Form for new responses, open the Form inside your Google Drive and click the “Accepting Responses” option. You can re-open the form anytime later by checking the “Not Accepting Responses” button.

Subscribe to our Email Newsletter