Setting an alarm to manually toggle a Google Form open and closed is a poor use of your time.

If you forget, students miss deadlines or late survey submissions slip through the cracks and mess up your data.

Google Forms does not include a built-in scheduling feature to automate this availability window.

You can solve this limitation by writing a brief Apps Script to handle the exact timing for you.

The setup takes about five minutes, and it ensures your form accepts responses precisely when you dictate.

What do you need before scheduling a Google Form with Apps Script?

Before writing any code, you need to gather a few details and check your account settings. Apps Script runs in the background on Google's servers, meaning it needs explicit instructions on where to find your form and what timezone to respect.

  • The exact Form ID Apps Script needs to know which file to target. Open your Google Form in edit mode and look at the URL in your browser. The Form ID is the long string of random letters and numbers sitting between /d/ and /edit. Copy this string and save it to a notepad.

  • Editor permissions The script cannot modify a form if you only have view access. Ensure you are either the owner of the Google Form or have been granted full Editor permissions by the owner. If the form sits in a Shared Drive, your workspace role must allow file editing.

  • A standalone or bound script project You can attach a script directly to the form or run it independently. To bind it directly to the form, click the three-dot menu in the top right of your Google Form and select Script editor. This opens a new tab with a blank Apps Script project automatically linked to your account.

  • Project timezone alignment Scripts default to the timezone of the server or the account that created them. If your script thinks it is in London but your deadline is in New York, your form will close at the wrong time. You must verify the project timezone before setting any schedules.

To check your script's timezone, click the gear icon (Project Settings) on the left sidebar of the Apps Script editor. Look for the Time zone dropdown and ensure it matches your local time or the time you intend to use for your deadlines.

If you are coordinating a massive data collection effort across different regions, always standardize on one timezone - usually UTC or the headquarters' local time - to prevent confusion when reviewing timestamps.

How do you write the Apps Script to open and close a Google Form?

The code to control a Google Form is straightforward. We will use the FormApp service, which is Google's built-in library for interacting with forms programmatically.

Below is a complete script containing two functions: one to open the form and one to close it.

// Replace this string with your actual Form ID
const FORM_ID = '1aBcD2eFgH3iJkL4mNoP5qRsT6uVwX7yZ8';

function openFormForResponses() {
  const form = FormApp.openById(FORM_ID);
  
  // Enable the form to accept submissions
  form.setAcceptingResponses(true);
  
  Logger.log('Form is now open: ' + form.getTitle());
}

function closeFormToResponses() {
  const form = FormApp.openById(FORM_ID);
  
  // Disable the form
  form.setAcceptingResponses(false);
  
  // Set the message respondents see when they visit a closed form
  const closedMessage = 'The deadline for this submission has passed. Please contact the administrator for late exceptions.';
  form.setCustomClosedFormMessage(closedMessage);
  
  Logger.log('Form is now closed: ' + form.getTitle());
}

Copy this code and paste it into the Apps Script editor, replacing the default myFunction() block.

The first line defines FORM_ID as a constant. By placing it at the top outside of any function, both the opening and closing functions can reference the same ID. Make sure you keep the single quotes around your ID string.

Inside openFormForResponses(), the script calls FormApp.openById(). This tells Google to fetch the specific file. Then, setAcceptingResponses(true) flips the internal switch in the form settings, making it live for respondents.

The closeFormToResponses() function does the exact opposite. It passes false to the response toggle.

It also utilizes setCustomClosedFormMessage(). This is highly recommended. If you do not set a custom message, Google displays a generic "This form is no longer accepting responses" note. Providing specific context - like an email address for late appeals or a timeline for when results will be posted - prevents respondents from emailing you in a panic.

Before moving to the scheduling phase, test your code manually. Select openFormForResponses from the function dropdown at the top of the editor and click Run.

Google will prompt you to authorize the script. This happens because the code is asking for permission to manage your Google Forms. Click Review permissions, select your Google account, and click Allow. If you see a warning that Google hasn't verified the app, click Advanced and then Go to script (unsafe). Since you wrote the code, it is safe to proceed.

How do you configure time-driven triggers to automate the schedule?

Code sitting in an editor does nothing until an event tells it to execute. In Apps Script, these events are called triggers.

To schedule your form to open and close automatically, you need to set up time-driven triggers. These act as alarms that tell Google's servers to run your specific functions at designated dates and times.

Follow these steps to configure manual time-driven triggers in the Apps Script dashboard:

  1. Look at the left sidebar of the Apps Script editor and click the clock icon labeled Triggers.
  2. In the bottom right corner of the screen, click the large + Add Trigger button.
  3. A configuration modal will appear. In the first dropdown (Choose which function to run), select openFormForResponses.
  4. Leave Choose which deployment should run set to Head.
  5. Under Select event source, change the dropdown from From form to Time-driven.
  6. Under Select type of time based trigger, choose Specific date and time.
  7. A new text box will appear. Enter your desired opening timestamp in the format YYYY-MM-DD HH:MM (for example, 2024-10-15 09:00).
  8. Click Save.

Your form is now scheduled to open. You must repeat this entire process to schedule the closing time.

Click + Add Trigger again. This time, select closeFormToResponses as the function to run. Set the event source to Time-driven, select Specific date and time, and enter your deadline timestamp (for example, 2024-10-22 17:00).

The Triggers dashboard will now list two active schedules. You can edit or delete them at any time by hovering over the row and clicking the pencil or trash can icons.

Pay attention to the Failure notification settings option in the trigger modal. By default, Google sends you a daily digest if a script fails. When dealing with strict deadlines, it is wiser to change this to Notify me immediately. If the script fails to close the form due to a server error, you want to know right away so you can toggle it manually.

How do you handle complex recurring schedules like weekly quiz windows?

Setting specific dates manually works fine for a one-off event. However, if you manage a repeating schedule - like a quiz that opens every Monday morning and closes every Friday afternoon - manually creating triggers every week becomes tedious.

If you regularly run weekly assessments, you might already convert a quiz to a Google Form to build the questions. You can pair that efficiency with programmatic triggers that automatically recreate your schedule.

Instead of using the manual UI dashboard, we can write a function that uses ScriptApp to generate the triggers for us.

function createWeeklyTriggers() {
  // First, wipe out any existing triggers to prevent duplicates
  deleteExistingTriggers();
  
  // Schedule the form to open every Monday at 8:00 AM
  ScriptApp.newTrigger('openFormForResponses')
    .timeBased()
    .everyWeeks(1)
    .onWeekDay(ScriptApp.WeekDay.MONDAY)
    .atHour(8)
    .create();
    
  // Schedule the form to close every Friday at 5:00 PM (17:00)
  ScriptApp.newTrigger('closeFormToResponses')
    .timeBased()
    .everyWeeks(1)
    .onWeekDay(ScriptApp.WeekDay.FRIDAY)
    .atHour(17)
    .create();
    
  Logger.log('Weekly schedules created successfully.');
}

function deleteExistingTriggers() {
  const allTriggers = ScriptApp.getProjectTriggers();
  
  for (let i = 0; i < allTriggers.length; i++) {
    ScriptApp.deleteTrigger(allTriggers[i]);
  }
}

The createWeeklyTriggers function uses ScriptApp.newTrigger(), which is the code equivalent of clicking through the manual setup modal.

Notice the chain of commands: .timeBased().everyWeeks(1).onWeekDay(ScriptApp.WeekDay.MONDAY).atHour(8). This syntax is highly readable and ensures the script runs during the 8:00 AM hour every Monday.

The deleteExistingTriggers function is critical. Every time you run a script that creates triggers, Google adds them to your project. If you accidentally run the creation script five times, you will end up with five identical triggers trying to open the form simultaneously.

By calling deleteExistingTriggers() at the very beginning of the setup, the script cleans the slate before building the new schedule.

To implement this, paste the code into your editor, select createWeeklyTriggers from the top dropdown, and click Run. You only need to run this setup function once. After that, Google's servers will handle the weekly repetition indefinitely.

Why is your scheduled Google Form not opening or closing?

Even with correct code, background automation can sometimes fail due to account settings or Google server quirks.

When a form stays closed on deadline day, do not panic. Open your Apps Script editor, click the Executions icon on the left sidebar (it looks like a bulleted list), and check the status of your recent script runs. The error messages there will point you toward the fix.

Symptom Common root cause Step-by-step resolution
Form opens hours earlier or later than expected The Apps Script project timezone does not match your local timezone. Open Project Settings (gear icon). Change the Time zone dropdown to match your local time. Update your triggers.
The script logs say "Exception: You do not have permission to call FormApp.openById" You lost Editor access to the Form, or it was moved to a restricted Shared Drive. Ask the file owner to reinstate your Editor permissions, or duplicate the form to your own Drive and update the FORM_ID.
Script fails with "Authorization required" You added new services or changed the code, but the trigger lacks permission to use them. Select your function in the editor dropdown and click Run manually. Accept the Google OAuth prompts that appear.
The form toggles open and closed repeatedly You ran a programmatic trigger script multiple times, creating duplicate schedules. Open the Triggers dashboard (clock icon). Delete all duplicated rows manually, or run a cleanup function.
Executions log says "Exceeded maximum execution time" Google's servers hung up while trying to connect to the Form service. This is a rare, temporary server timeout. Manually toggle the form, and the trigger should work normally next time.

What are the quotas and execution limits of Apps Script triggers?

Google provides Apps Script for free, but it enforces strict quotas to prevent abuse and manage server load. For a simple script that merely opens and closes a form, you are unlikely to hit the heavy execution limits.

However, trigger limitations can dictate how you design complex schedules.

Limitation Limit value Note on behavior
Total triggers per script 20 triggers You cannot schedule 30 different exact-date events in one project. You must use programmatic loops instead.
Trigger total runtime 90 minutes / day Opening a form takes milliseconds, so scheduling scripts rarely consume this quota.
Time-driven accuracy +/- 15 minutes A trigger set for 9:00 AM might run at 9:08 AM. Google does not guarantee down-to-the-minute execution.
URL Fetch calls 20,000 / day Only relevant if your close function also tries to send data to an external API webhook.

The most important limit to understand is the trigger timing accuracy.

When you set an Apps Script trigger for a specific hour or minute, Google places it in a queue. Depending on server traffic, the script might execute exactly on time, or it might be delayed by up to 15 minutes.

If your deadline is absolutely strict - for example, a high-stakes exam that must close at exactly 12:00 PM - you should not rely solely on a scheduled trigger. Instead, schedule the trigger for 12:00 PM, but clearly communicate to respondents that the form closes "by 12:15 PM" to account for the server window.

FAQ

Can I schedule a Google Form to close down to the exact second?

No. Apps Script time-driven triggers operate within a 15-minute variance window depending on Google's server load. If you select 5:00 PM, the script may run anywhere between 5:00 PM and 5:15 PM. You cannot force Google's infrastructure to execute a background trigger at a precise second.

What happens to respondents who are mid-submission when the form closes?

If a respondent has the form open but the script executes before they click submit, their submission will be blocked. When they attempt to submit, Google Forms will refresh and display your custom closed message instead. Any typed answers that were not submitted are lost.

Do Apps Script schedule triggers run if my computer is turned off?

Yes. Apps Script runs entirely on Google's cloud servers. Once you set up the trigger in the dashboard and authorize the script, you can close your browser and turn off your machine. The form will still open and close on schedule.

How can I automatically notify respondents when the form availability window changes?

You cannot natively email respondents through Google Forms unless you already collected their email addresses in a previous step. To notify people, you would need to write additional Apps Script code using MailApp to email a predefined mailing list. Alternatively, embed your form on a Google Site and update the surrounding text to communicate the schedule.

Automating your form availability removes the mental burden of watching the clock on deadline day. If you frequently handle document-heavy workflows, you might also look into Doc2Form to instantly generate your Google Forms from existing PDFs or briefs, keeping your entire setup process as hands-off as your new automated schedules.