Zylvyn
Zylvyn

Reputation: 11

Creating a task scheduler in GAS?

So I'm just getting back into scripting with GAS and I'm trying to make a scheduler/reminder system for tracking periodic maintenance that has to be done.

The idea is a form that fills info to a spreadsheet (easily done), and then iterate through the sheet and create events on a dedicated calendar for every 'job', with recurrence set to how often the job needs doing. ie: every 3 months, clean the drains.

I have this part of it working. What I'm wondering is... is it possible to have a script call a function at a specified date and time? Like instead of a calendar event that emails you a reminder about the event on the day of (or whenever), maybe call a function so that I can email them some details about the job (again, pulling from the sheet, which is simple enough) and maybe throw it at Pushbullet API to push to the user's phone/browser. I've played with PB's api, and everything, the ONLY part of this that I don't have working is the scheduled future script firing.

If this isn't possible, would anyone be able to recommend an alternative?

Edit: For clarification, I'd be wanting to set up a one-time execution of a function on say ... June 14th. In terms of recurrence, I can just have it set the next scheduled run during the execution.

Upvotes: 1

Views: 1386

Answers (2)

Wicket
Wicket

Reputation: 38286

Yes, it’s possible. Use time-driven triggers. For details see https://developers.google.com/apps-script/guides/triggers/installable

Upvotes: 1

Eduardo Conte
Eduardo Conte

Reputation: 1203

If I understood correctly, you need to use the Trigger!

enter image description here

Upvotes: 1

Related Questions