How to Integrate Google Apps Script & Trigger with an AppSheet App

Dear Marc,
It doesn’t go.
The app sheet changes the cell value in the sheet but the on Change function doesn’t run.
Now it doesn’t run even if I change the cell directly on the sheet.
Thanks for your help.
Denis

Did you install the trigger?

Yes.
I’ve installed a trigger with the event “At change” but the function Onchange doesn’t run
Is it correct?
Thanks

This is the trigger error

Una recente esecuzione del tuo script Share your care non è riuscita. Il riepilogo degli errori è riportato qui di seguito. Per configurare i trigger per lo script o per modificare le impostazioni relative alle notifiche di errore, fai clic qui.

Script utilizzato dal documento Share your Care.

Avvia Funzione Messaggio di errore Attivazione Fine
23/11/21 16.18.05 CET onChange TypeError: Cannot read property ‘getA1Notation’ of undefined change 23/11/21 16.18.05 CET

Cordiali saluti,

Google Apps Script

Hai bisogno di aiuto? Consulta la documentazione di Google Apps Script. Non rispondere a questo messaggio. (c) 2021 Google

If your onChange function is returning an error, that means it in fact is running. You just have an error in your code. That particular error is telling you that whatever you’re trying to run getA1Notation() on, is undefined.

Ok. I understand.
The problem is that this error is given only with the trigger installed, not if I change the cell manually (in this case the function run correctly)
Sorry but why do I need the trigger? Is not enough the function onchange(e) for making an unstable trigger?
Many thanks for your time.

Off the top of my head, I’m not actually sure that you do need it.

I suspect your issue is with determining the correct range, which is why it is erroring out because your range is undefined. Manual edits in the sheet are mostly just single cell ranges, but an edit via Appsheet is going to be an entire row.

I know I’ve posted something before about how to get the range from an Appsheet edit onChange. You should search through other threads about GAS on here.