email notification if cell is changed

后端 未结 2 1030
广开言路
广开言路 2020-11-30 05:20

need help with google script. I have multiple row spreadsheet.

Need a script that does the following:

If any cell in col

2条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 05:42

    The correct way to track a cell-change event is to use the event object "e" with onEdit trigger. The event object contains the range that was edited and hence you can always get the content of the cell that was changed.

    function sendNotification(e){
      var range = e.range;
      range.setNote('Last modified: ' + new Date());
    }
    

    NOTE: The function name shouldn't be onEdit which is a special name in apps script. The onEdit function won't allow to send email because of LIMITED authMode.

    Here is an apps script which allows to send an email if a cell is edited in a specific range. It also allows to send the entire row, entire column or a custom range to be sent in the notification email.

提交回复
热议问题