Google app script integration event

apt
New Member

Hi! There is a post (How to Integrate Google Apps Script & Trigger with an AppSheet App) describing a way to “capture” AppSheet change on the spreadsheet and continue the workflow on our Google Workspace side.

The thing is, maybe things changed, but the OnChange event which is described as the right one for this integration doesn’t provide the source object anymore (Event Objects  |  Apps Script  |  Google Developers). So we can’t find out what was changed and the actions to take.

Does anyone know how to do this integration?

0 4 531
4 REPLIES 4

Did you actually try it? I believe it still does, regardless of what that doc says.

Of course I tried. And tried many different ways, like trying to getting activeRange and selecting Spreadsheet and sheet from ID. Which doesn’t provide the target range that AppSheet is editing.

Source object is empty as you can see in the attached image, each trigger makes 2 changes: OTHER and EDIT. Probably adding row and writing values to cells.

I have a manually installed on change trigger for this script
3X_6_3_639e61cd365fcaddbea422eae9e22f64236b81c4.png

Which as you can see uses e.source
3X_b_d_bdb68a72d6d152a8f21197f9a799449d7e47a709.png

This script has been running successfully for many months.

Coming back to this to update since I created a new onChange script today.

onChange Event Object definitely does include a source object. I do not know why it shows as blank in the log output, it does for me as well. JSON.stringify(e.source) does not work either. Maybe the logging system decided it was too much data to output?

You also need a certain oAuth scope for your script, which may not have been added if you were missing some bits of code. See this stackoverflow question:


Once you have that figured out, you can get your range via

e.source.getActiveSheet().getActiveRange()
Top Labels in this Space