Home > front end >  Overlap between onEdit(e) and onChange(e) triggers in Google Apps Script
Overlap between onEdit(e) and onChange(e) triggers in Google Apps Script

Time:01-13

According to https://developers.google.com/apps-script/guides/triggers:

onEdit(e) runs when a user changes a value in a spreadsheet.

On the other hand, onChange(e) has the following possible values for changeType according to https://developers.google.com/apps-script/guides/triggers/events:

The type of change (EDIT, INSERT_ROW, INSERT_COLUMN, REMOVE_ROW, REMOVE_COLUMN, INSERT_GRID, REMOVE_GRID, FORMAT, or OTHER).

So:

Why does the onEdit(e) trigger fire up when I'm merely changing cell borders? Is changing the cell(s) format considered a change in value?

CodePudding user response:

This is most likely a bug.

Either onEdit is firing when it shouldn't, or the documentation should be updated to include border changes. Based on the current documentation, it's clear it should only trigger when values change.

For future reference, posting here the corresponding Issue Tracker (which you probably filed):

  •  Tags:  
  • Related