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,082
5 REPLIES 5

GreenFlux
Participant V

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
Participant V

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