Trigger Not getting executed when a new row is added through AppSheet form

I have created a trigger in appsheet using the following code:
function createTrigger() {
ScriptApp.newTrigger(โ€˜sendWhatsappToClientโ€™)
.forSpreadsheet(ss)
.onFormSubmit()
.create();
// Toast notification.
SpreadsheetApp.getActiveSpreadsheet().toast(โ€œTriggerโ€™s added.โ€, โ€œNotificationโ€, 5);
}

The trigger is being created but when a new row is added in sheet using appsheet, then the function โ€˜sendWhatsappToClientโ€™ is not runningโ€ฆ

However when it is added through Google form,it is running perfectlyโ€ฆ

0 5 1,112
5 REPLIES 5

You may want to consider using a Workflow-Webhook to the Whatsapp API instead, so you can do everything in the AppSheet editor.


But if you do stay with the script method, hereโ€™s a great post by @LeventK with a ton of good info on integrating Apps Script.

Steve
Platinum 4
Platinum 4

onEdit triggers do not fire when data is edited and synced to the spreadsheet via AppSheet.

I went thought these files, but on edit trigger runs if anything in sheets is modified. I want to run a trigger only when a new row is added through appsheet, but couldnโ€™t find a solution anywhere. Itโ€™ll be great if I can get some help on using webhooks through which only a part of code is run with the event object attached to it.

Hereโ€™s a similar use case to yours that you could refer to:

Read the AppSheet help docs for how to pass JSON to the webhook.

@Kaushal_Didwania1
Instead of onEdit(e), you need to use onChange(e) installable trigger to get what you want.

Top Labels in this Space