I am having trouble with a clock based trigger I am trying to create. This is for google apps script. This script is supposed to call a function that will email information at 5 am from a spreadsheet. I know the function works because I had used it with the 5 am to 6 am built in trigger, but they want it at exactly 5 am and not anytime in that hour range. Here is my code:
var SOD_Briefing_Trigger = ScriptApp.newTrigger("sendBriefingByEmail")
.timeBased().
atHour(5)
.create();
Everytime I try to run or debug it I get an error message of:
Needs a positive frequency of recurrence
Sorry if this seems like a newb question. I spent a few days searching here and google generally for a similar issue. I could not find anything.
That error message is a bit cryptic. If you just say “atHour”, the system knows the “time” but not the “frequency”.
This following should work.
Note the “everyDays” call. That means run it every X day(s) -every day in this call. You can change it to other frequencies based on the calls documented here. Some other examples – “atDate” (if you just want it run today or tomrorow) and “onWeekDay” (if you want it run every Monday for eg.).