Practical scripting.
WHAT IT CAN REACH
Sheets, documents, slides, forms Mail and calendar Drive External services over the web Other Google APIs
WHAT TRIGGERS EXIST
Manual execution Opening or editing a document Form submission Time-based schedules Web requests to a published endpoint
WHAT TO KNOW ABOUT QUOTAS
Execution time, daily triggers, mail sent and requests made are all limited.
WHY THAT MATTERS
Scripts fail when limits are reached, and the failure may be silent.
WHAT TO DO ABOUT LONG WORK
Process in batches, storing progress, and continue on the next execution.
WHAT TO AVOID
Reading and writing spreadsheet cells one at a time.
WHY
Each call is slow, and a loop of them exceeds the time limit.
WHAT TO DO INSTEAD
Read a whole range into an array, process it, and write it back once.
WHAT THAT CHANGES
Execution time, dramatically.
WHAT TO ADD
Error handling, and notification on failure.
WHY
A silently failing scheduled script is discovered weeks later.
WHAT TO KEEP IN VERSION CONTROL
The code, using the command-line tooling.