0
votes

I wrote a small script bound to a Google spreadsheet that reads an email-address from a cell in the last row and sends an email to it. The values are collected by a WebApp (not by Google form).

I tried all kind of triggers. The time driven triggers work, but the spreadsheet triggers don't work. I tried all of them. If I change manually some cell in the spreadsheet the onEdit trigger is working, but it doesn't fire up when the sheet was changed by another script.

2
You could duplicate the onEdit() code in the web app, and run it from the web app.Alan Wells

2 Answers

0
votes

Google's dev says : The onEdit() trigger runs automatically when a user changes the value of any cell in a spreadsheet. but it doesn't precise the change could be from script or not.

You'll find here a comment from HDCerberus :

I'm not at my PC to write a full response, but at a glance it could be the OnEdit trigger, which ONLY works when the sheet is edited manually, and NOT by a script. Are you expecting it to run when the sheet is edited manually or by a script?

-1
votes

Not every change triggers onEdit(). Please take a look on answer from topic Detect user inserting row or column in a google spreadsheet and reacting in a script - you will find registered bugs and one of them says that values written by scripts do not trigger onEdit().