Skip to content
Advertisement

Google Apps Script with Immediate Time-Driven Trigger

I’m attempting to test a script that I’m working on. The script is fine, it executes successfully when I trigger it manually. I’m just doing a “sanity check” on a time-driven trigger and it’s definitely pushing the bounds of my sanity. I’ve set it up for a one-time “Specific time / date” execution to test that it will run after I leave it to execute on it’s own a la cron or similar.

My problem is that it never executes, I’m setting it up for 2, 3, or 5 minutes after the time when I save it. Is this not enough time for it to make it’s way into Google’s cron queue? Because I can’t get this script to execute on a time-driven trigger.

Also, for what it’s worth, all Google Apps (Spreadsheet / Docs / etc) calls are being done via the .getSheetByID() method so it’s not related to the .getActiveSheet() problem that can happen when you execute a script with the working document already open in your browser.

Advertisement

Answer

This is a poor answer, but I did find that I was able to simply set a time-driven trigger with “every minute” execution, which was enough to finish my work, though I can imagine scenarios where you would want a single trigger as the interface seems to promise, but for me it wouldn’t work with soon-scheduled events.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement