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

How can I get the information from a column next to the active cell to be included in the email?

$
0
0

I have this script running which works fine. However as you see, it only copies the information of the active cell in Column 10 toString. How can I get the information next to it in Column 11 to be included in the email? I've tried numerous options without luck.

function sendNotification() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getActiveSheet();
    if(sheet.getName()=='Dispatch Log'){
  var cell = ss.getActiveCell();
  var cellcol = cell.getColumn();
      if(cellcol == 10){
  var cellvalue = ss.getActiveCell().getValue().toString();
  var recipients = "tor@domain.com";
  var subject = 'Pickup Requested '+cellvalue;
  var body = 'A new Pickup has been placed for ' + cellvalue + '. Please coordinate with dispatch.';
  MailApp.sendEmail(recipients, subject, body);}
    }
} 


Viewing all articles
Browse latest Browse all 9782

Trending Articles



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