Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

243
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda