0
votes

I have recently taken up on writing in Google Apps Script.

Currently I have created a function that is "attached" or "linked to" a Google Form. I did this by going to the editing screen for my form and accessing the script editor from there.

The code creates a new spreadsheet and links the form to that spreadsheet. The reason for this is that every week I would like to create a new spreadsheet for the form to submit to.

The issue I am running into is that when I try to manually make a trigger I do not see the option for it. The steps I've taken are as follows Resources -> Current Project's Triggers -> Click to add a new one.

The only options I see are "on form submit" and "on open"

Is there a way to programmatically add a time based trigger?

1

1 Answers

1
votes

There is a way for creating the time based trigger. When you want to create a trigger at Feb. 1, 2017, 18:00 using GAS, you can do that by following script. 'test' is a function you want to execute.

var tr = new Date(2017,2-1,1,18,00);
ScriptApp.newTrigger('test').timeBased().at(tr).create();

Reference URL is https://developers.google.com/apps-script/reference/script/script-app#newTrigger(String).