How many times an editor on a google sheet can consume an onOpen() trigger?

Samy

using google apps script, I have written a big code that take high execution time whenever you increase the amount of sheets in the spreadsheet, i want to overcome the problem by dividing the custom function into 6 custom functions, each will run quickly on its own, but in order to do that, I will assign an onOpen() trigger through a menu on the UI that this specific user can only click and execute its related function. my question is if I have 6 users per 6 functions, how many times a single user can open a sheet and use that menu daily? i.e., user1 will have to use 5 spreadsheets daily, in each spreadsheet he will access 30-50 sheets.. that's a total of 250 sheets (max). by doing this, will he go over the triggers daily limit? this will surely make my code run smoothly, but will consume many simple triggers per user.

TheMaster

Disclaimer: Not tested

Quotas in questionref:

  • Triggers: 20 per user per script
  • Total trigger run time: 90min/day(upto 6hr/day)

Inferences/Assumptions:

  • The Triggers refer to the number of triggers created and not the number of times each trigger is run. i.e., A user can open a spreadsheet as many times as he possibly can and still have the onOpen() trigger(1 trigger) execute, provided the user doesn't cross other quotas.

  • Simple onOpen() has a limit of 30 seconds. At a max runtime of 90 minutes/day and assuming a simple trigger runs for 30 seconds and simple triggers count towards 90minute quota, Users can open a spreadsheet upto 180 times and can still expect the onOpen() to run.

  • Manual menu clicks don't count towards total trigger runtime. So, I don't think it counts towards triggers run time or the number of triggers created(unless the script programmatically creates a trigger)

Workarounds:

Highly optimized scripts have, rarely a reason, to split up a script due to execution time. Make sure you've followed all the best practices. Related Questions:

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to add the onOpen trigger to a Google Sheet with Google Apps Script?

How to Use onOpen Trigger Script to Change Google Sheet Behavior?

How to not install trigger more than once with onOpen in google script?

How to consume a google sheet using google api that has a domain restriction

How can I create multiple trigger events in Google Sheet for a single sendMailEdit function?

How can I duplicate rows of data "x" times where x is variable in google sheet?

Google sheet return how many tab are visible

How do I call a installed onOpen() trigger?

Trigger a google Sheet

How many times onUpdate function will trigger on batch update?

How many times can the Garbage Collector be called?

How many times addTelemetryInitializer can be called?

How many times recursion can be called?

Google App Scripts onOpen() trigger doesn't work on sheets

How to repeat cell value X times in google sheet using arrayformula?

onOpen on specific Sheet in AppScript

How to fix the script to work on certain sheet only in the onOpen function?

Time Trigger on Google Sheet Add On

How can I rearrange a Google Sheet using the data within the sheet?

How can I assign a Google Sheet script to only one sheet?

How can I guarantee that websocket onopen to be called

Filter on google sheet with many rows

jQuery - on click with * selector trigger too many times

Input change trigger too many times

How can I track how many times my script is run?

How can I register how many times a 'user' visits a website?

How can I fetch Google Sheet name from Google sheet ID using python and google sheets API?

How many times can a word be created using the input string?

How many times can data be read from a USB flash drive?