I'm looking to call UrlFetchApp.fetch()
based on user input on a sheet but nothing happens. No errors, just silently ignores the call. Same goes for MailApp.sendEmail()
and GmailApp.sendEmail()
This is on a Google Apps domain, and only domain users are using the Google Sheet.
The onEdit(e) trigger runs automatically when a user changes the value of any cell in a spreadsheet.
Under Run, select the name of function you want to trigger. Under Events, select either Time-driven or the Google App that the script is bound to (for example, From spreadsheet). Select and configure the type of trigger you want to create (for example, an Hour timer that runs Every hour or an On open trigger).
The only way you can debug an event object is to print the value of e after an event was made. You can view each event by clicking the Executions tab of your Apps Script.
Simple triggers like onOpen
or onEdit
are not able to do anything that requires authorization like sending mails because they run silently and anonymously.
This is all explained in the documentation .
You should simply rename your onEdit
function to something else - SpecialOnEdit
for example ? - and create an installable trigger (documentation) from the script editor menu (ressources/triggers/create a new trigger...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With