S
S
serw_802020-12-25 05:00:44
Google Apps Script
serw_80, 2020-12-25 05:00:44

How to send an email alert when a google spreadsheet cell is full?

There is a Google-table for the approval of applications. In the last column, the status is entered from the list - agreed.

How to make it so that when this status appears in the cell, a letter will fly away stating that the application has been approved for a specific addressee?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grigory Boev, 2020-12-25
@serw_80

Use the onEdit (event) trigger. Here is the code snippet:

function onEdit(event) {
  //Возникает при изменении ячейки
  var ss = event.source.getActiveSheet();//Текущий лист
  	var address = event.range.getA1Notation().toUpperCase();//Адрес ячейки
  var row = event.range.getRow();							//Номер строки
  var col = event.range.getColumn();						//Номер столбца
  var newValue = event.value;								//Новое значение
  var oldValue = event.oldValue;							//Старое значение
  
  if (["Лист1","Лист2"].indexOf(ss.getName())==-1) return;	//Указываем на каких листах должен работать скрипт
  
  //Что-то делаем...
  };

It remains to register the sending of the letter. This is done using MailApp.
Most likely, a simple trigger will not allow you to send a letter, then you need to make a regular trigger and hang it on onEdit ().

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question