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.
Disclaimer: Not tested
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)
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.
Comments