We want an Action that changes a text value, ...

(Tom Graham) #1

We want an Action that changes a text value, to also trigger a Google Apps Script to run.

The script is setup to run ‘on edit’. And this works if we edit the text value manually in the spreadsheet. But if the value is changed by AppSheet, then an the scripts is not being triggered to run.

Any ideas on why this is happening and what we can do? Thanks!

(Aleksi Alkio) #2

It’s not my “homeland” but you can trigger the script with the workflow/webhook. When you use the workflow for that purpose, you can trigger that in many different ways and you can pass values with the JSON Body.

(Dinh Nguyen Nguyen) #3

@Tom_Graham Hi Tom, when using Google scripts with AppSheet, it’s important to note that there’s a restriction in the Google API that prevents changes made via the API from triggering Google scripts. This means that changes made to the spreadsheet via AppSheet will not trigger your scripts.

As such, your best bet would be to use @Aleksi_Alkio’s approach, which is to trigger the script using a webhook.

(Levent KULAÇOĞLU) #4

@Harry onChange(e) trigger works with AppSheet. However onOpen(e) and onEdit(e) triggers will not work. I have many apps using onChange(e) triggering. FYI.

(Dinh Nguyen Nguyen) #5

@Levent_KULACOGLU Thanks Levent for pointing that out.

(Levent KULAÇOĞLU) #6

@Tom_Graham you should be enclosing your code within an onChange(e) trigger. onEdit(e) trigger will not work with AppSheet.