I am creating an Editor Addon that let me create automation tasks.
For example I want to be able to create tasks on the model Trigger-Condition-Action such as
When the spreadsheet '123', sheet 'Sheet1', is updated
If Column A equals "Done"
Copy the row to spreadsheet '789' sheet 'Sheet2'
Because Google imposes quota on the number of triggers I can create,
onEdit
trigger per spreadsheet. But what if I create an Edit trigger on 20+ different spreadsheets?Google limitation is 20 triggers / user / script.
Does it mean that a user using my addon will be limited to 20 spreadsheets?
For the task above, the action should be run only when the condition is met. On every onEdit
, I need to check for the condition. If I store the user defined tasks on a separate backend, it means I have to call UrlFetch
inside onEdit
to check for the condition, which is very inefficient given how often onEdit
runs.
Is there any best practice to do that without blowing up the 500 KB / property store
quota?
I couldn't find a strong reference but according to the comment from Cameron Roberts here
Although I can't find the documentation, I believe each document in which the add-on is installed would be treated as an individual script, so you wouldn't be limited to 30 documents.
I will call UrlFetch inside an installable onOpen trigger to retrieve all the tasks of the user. Cache it and test the condition inside onEdit for every edit operation.