Why Google Sheets API Writes Don't Trigger onEdit or onChange Events
A common source of confusion for Google Apps Script developers is that writing data to a spreadsheet via the Sheets API does not fire onEdit or onChange event triggers, as these only activate on direct user interactions. The distinction matters because script executions and external API requests are treated separately from user-driven edits by Google's trigger system. Developers can verify this behavior using a test setup involving a bound Apps Script project with installed triggers for edits, changes, and form submissions. Running a script write and an API values.update call in controlled conditions will show that neither produces a trigger execution, unlike a manual cell edit. Understanding this separation is essential for correctly architecting automation workflows that rely on spreadsheet event handlers.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in