Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

242
Views
Google Apps script- automated email when the checkbox is checked

**Hello All, I would like seek help on below google sheet script which is when the checkbox is checked it cannot auto send email with data column A to E and script i need to add?

const wholeSheet = SpreadsheetApp.getActive();
let sheetName = "name of your sheet";
let activeSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName);

function sendEmailWhenBoxIsChecked() {
  let columnIndexOfCheckbox = 6; //column index of where your checkbox is located
  let rowIndexOfCheckbox = 2; //column index of where your checkbox starts
  let activeCellOfActiveSheet = activeSheet.getActiveCell();
  if (
    activeCellOfActiveSheet.getColumn() === columnIndexOfCheckbox
    && activeCellOfActiveSheet.getRowIndex() >= rowIndexOfCheckbox
    && !activeCellOfActiveSheet.isBlank()
  ) {
    let checkbox = activeSheet.getActiveCell();
    if (checkbox.isChecked()) {
      GmailApp.sendEmail("recipient email", "Email header", "Email content or body");
    }

  }

}

function onEdit() {
  let createTrigger = true;
  ScriptApp.getProjectTriggers().forEach(trigger => {
    if (trigger.getEventType() === ScriptApp.EventType.ON_EDIT && sendEmailWhenBoxIsChecked.name === trigger.getHandlerFunction()) createTrigger = false;
  });
  if (createTrigger) {
    ScriptApp.newTrigger(sendEmailWhenBoxIsChecked.name)
      .forSpreadsheet(wholeSheet)
      .onEdit()
      .create();
  }
}

enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!