简体   繁体   中英

How to get around time trigger limitations for Add-Ons in Google App Script?

I want to develop an Add-On to Google Sheets that gets statistics from multiple APIs every 15 minutes (at least).

I use time triggers for this in my script (which I want to make into an add-on) and that is fine.

However, I read that an Add-On can only have a time trigger with a frequence of 1 hour. This would make it impossible to make the Add-On as I need more frequent data than that.

Are there any workarounds around this issue?

Would it be feasible to have a script start and then continously add and delete a time trigger in some other way, like "run in 15 minutes again"?

As it's stated in the documentation for the Add-ons triggers, you can't set it for less than an hour [1]:

Time-driven triggers cannot run more frequently than once per hour.

Also, they can't have more than one type of trigger at the same time, meaning you could only have one time-driven trigger [1]:

Each add-on can only have one trigger of each type, per user, per document. For instance, in a given spreadsheet, a given user can only have one edit trigger, although the user could also have a form-submit trigger or a time-driven trigger in the same spreadsheet. A different user with access to the same spreadsheet could have their own separate set of triggers.

Conclusion: I don't see any workaround possible for this.

[1] https://developers.google.com/gsuite/add-ons/concepts/triggers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM