Abhi
Abhi

Reputation: 177

Google form which starts and stops accepting repsonses automatically with time on daily basis?

I want to create a form which stops "Accepting responses" between 10am to 2pm daily. All of the other time it should accept responses from the users Any ideas on how to achieve this with the current functionality of google forms and google app script?

PS: My plans for the above task which seems to be a failure now: 1) Use the onOpen() trigger to run a google app script bound to my form. This script will check the current time and it if falls between 10am - 2pm will use "form.setAcceptingResponses(false); " to close the form is specified time slot. However, I have learn't that onOpen() trigger doesn't run when a user accesses a form for submitting response, but only when a user opens the form with edit access..so gasp my plan is a big flop!

(Please correct me if I'm wrong with my understanding on triggers here, I'm new to this stuff)

So ppl, any workaround for the same??? Thanks in advance :)

Upvotes: 0

Views: 1539

Answers (1)

niwox
niwox

Reputation: 401

Maybe you can use: Time-driven triggers
https://developers.google.com/apps-script/guides/triggers/installable
But I believe you will have problem with timing consistenty from the server

Upvotes: 1

Related Questions