1

I would like to apply this to let's say "Weekly" and "Monthly" tab. Here's my script:

function sendAlertEmailWhenCellValueIsNotEmpty(){
  //send an email alert when cellToWatch is not empty
  //set this function to run through a time driven trigger
  //choose resource> Current project's triggers> Add a new trigger>Time-driven>Day Timer
  //see https://productforums.google/d/topic/docs/39Ysmg7nAjk/discussion

  //edit the following variable to fit your needs
  var cellToWatch="DAILY!W12";
  var mailAddress="someone@gmail.com";
  var emailSubject="Spreadsheet alert:BECKMAN COULTER UNICEL DXI800 MISSING DAILY MAINTENANCE";
      var emailBody="This is an email alert from your google spreadsheet:BECKMAN COULTER UNICEL DXI800 MISSING DAILY MAINTENANCE" 

  if(SpreadsheetApp.getActiveSpreadsheet().getRange(cellToWatch).getValue()!=""){
    MailApp.sendEmail(emailAddress,emailSubject,emailBody);
  }
}
1
  • Welcome to Webapps. It looks to me that you got this code from somewhere. But do not know how to read it. Please use the answer below as a starting point. Dec 17, 2019 at 9:00

1 Answer 1

0

In the script it is mentioned:

//edit the following variable to fit your needs
  var cellToWatch="DAILY!W12";
  var mailAddress="someone@gmail.com";
  var emailSubject="Spreadsheet alert:BECKMAN COULTER UNICEL DXI800 MISSING DAILY MAINTENANCE";
      var emailBody="This is an email alert from your google spreadsheet:BECKMAN COULTER UNICEL DXI800 MISSING DAILY MAINTENANCE" 
  • The variable vardefined in cellToWatch="DAILY!W12" refers to cell W12 on sheet DAILY
  • mailAddress="someone@gmail.com" mentions who the email will be sent to
  • emailSubject="Spreadsheet alert:BECKMAN .... is the Subject of the email
  • emailBody="This is an email.... is the body of the email.

Play around with these variables and see what you get.

And please start reading about scripting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.