1

I have a Google spreadsheet for which I have written a script which uses both onEdit and onChange triggers. I am trying to figure out the scenarios on which the events trigger. There are few scenarios like:

When I delete/add a value from/to an existing cell, I’m expecting the onEdit event to get triggered but instead sometimes onChange triggers even though the action is considered to be manipulation of an existing cell.

https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder#onchange

Similarly, when I delete a column, instead of onChange, onEdit event triggers.

Is there an order of priority based on which these triggers work when put together in a script?

Nimantha
  • 6,405
  • 6
  • 28
  • 69
zoro
  • 17
  • 5

1 Answers1

0

The doc you provided pretty much says it all. This might be caused by the possibility that onChange() is triggered by onEdit or vice versa, also as on how I understand the definitions on the Event docs, the Change events is pretty much about the whole spreadsheet, while the Edit is/can be specific to a certain (range of) cell(s).

I think this answer is very helpful, it might give you some ideas. Don't know if this one could also help, but I think the answer here is quite definitive.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
AL.
  • 36,815
  • 10
  • 142
  • 281