Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9843

How to apply "sendAlertEmailWhenCellValueIsNotEmpty" script to multiple tabs in Google Sheets

$
0
0

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);
  }
}

Viewing all articles
Browse latest Browse all 9843

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>