---
title: "Opening and closing Google Forms on time trigger using Google Apps Script"
author: "Martin Hawksey"
date: 2023-02-01T20:58:25+00:00
canonical_url: https://pulse.appsscript.info/p/2023/02/opening-and-closing-google-forms-on-time-trigger-using-google-apps-script/
markdown_url: https://pulse.appsscript.info/p/2023/02/opening-and-closing-google-forms-on-time-trigger-using-google-apps-script.md
categories:
  - "Forms"
  - "Intermediate"
  - "Snippet"
  - "Solutions"
tags:
  - "tanaikech.github.io"
featured_image: https://pulse.appsscript.info/files/2023/02/fig1-e1675284615235.png
description: "Here's a handy little snippet if you would like to programmatically open/close one of your Google Forms to responses for specific hours of the day. The script includes another trigger that will repeat opening/closing the Google Form for responses each day. As this snippet uses `.timeBased().at(date)`  it's easy for you to modify if you want to only have the form open to responses between two specific dates/times."
---

# Opening and closing Google Forms on time trigger using Google Apps Script

![Opening and closing Google Forms on time trigger using Google Apps Script](https://pulse.appsscript.info/files/2023/02/fig1-e1675284615235.png)

> This is a sample script for opening and closing Google Forms on time using Google Apps Script.

Here’s a handy little snippet if you would like to programmatically open/close one of your Google Forms to responses for specific hours of the day. The script includes another trigger that will repeat opening/closing the Google Form for responses each day. As this snippet uses `[.timeBased().at(date)**](https://developers.google.com/apps-script/reference/script/clock-trigger-builder#at(Date))`  it’s easy for you to modify if you want to only have the form open to responses between two specific dates/times.

Source: [Opening and Closing Google Forms on Time using Google Apps Script**](https://tanaikech.github.io/2023/01/18/opening-and-closing-google-forms-on-time-using-google-apps-script/)

 

---

*Published by [Martin Hawksey](https://pulse.appsscript.info/p/author/admin/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2023/02/opening-and-closing-google-forms-on-time-trigger-using-google-apps-script/](https://pulse.appsscript.info/p/2023/02/opening-and-closing-google-forms-on-time-trigger-using-google-apps-script/)*
