I want google sheets to send an email when a cell is edited in a specific column, however, the cell must match a specific word. I.e the email will only send if the cell text is equal to "Yes" or "No"
I've been able to get the specific column and Onedit trigger setup in google script editor, however, I haven't been able to work out getting the cell to match specific text
function sendEmail(event) {
// Getting the row
const ss = event.source.getActiveSheet();
const row = ss.getDataRange().getValues()[event.range.getRow()-1];
const currentColumn = event.range.columnStart;
if (ss.getName() !== 'Sheet1' || currentColumn !== 5 )
return;
var emailAddress= [email protected]
var emailBody= "Test"
var subject = "Test"
MailApp.sendEmail(emailAddress, subject, emailBody);
I want google sheets to send an email when a cell is edited in a specific column, however, the cell must match a specific word. I.e the email will only send if the cell text is equal to "Yes" or "No"