recently I was stuck with integrating Google Script (operating on my spreadsheet) and AppSheet. I read many posts and tricks over the internet and saw many people facing problems with it. I finally got it working with the following tricks. These are all available in various forums over the internet, but a summary might help.
Only onChange trigger works.
Avoid having any alert messages within the scripts.
var ss = SpreadsheetApp.openById(“1wdxU42mANDqOw0UJkhkCdq73nRjK82HtB8kVrFpIPZw”)Instead of .
getActiveSheet() kind of usage. This is because when Appsheet is updating data, the spreadsheet is not open and therefore getActiveSheet() will not work.
the event object within the onChange() method does not directly give the range selected/updated. But you can get it using
var source = e.source;
5.Finally, you need to add this trigger via Edit->Current Project Triggers option. Make sure you select the correct function to run, source as Spreadsheet and event type as OnChange.
Hope this helps.