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

140
Vistas
Delete row in google sheet via app scripts if columns meet criteria

I want to be able to delete a row if certain columns match the criteria. This is what I have so far:

function deleteEachRow(){
  let tempSheet = SpreadsheetApp.getActiveSpreadsheet();
  let sheet = tempSheet.getSheetByName("Intermediate");
   var RANGE = sheet.getDataRange();
  var rangeVals = RANGE.getValues();



}

from here I would like to find out if column[11] !=='' and column[12] ==='completed', if it meets the criteria then delete the row.

Any ideas?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

function deleteEachRow(){
  const ss = SpreadsheetApp.getActiveSpreadsheet();
  const sh = ss.getSheetByName("Intermediate");
  const sr = 2;//data start row
  const rg = sh.getRange(sr, 1, sh.getLastRow() - sr + 1, sh.getLastColumn());
  const vs = rg.getValues();
  let d = 0;
  vs.forEach((r,i) => {
    if(r[10] && r[11] == 'completed') {//column 11 and 12
      sh.deleteRow(i + sr - d++);//d increments on each delete
    }
  });
}
about 4 years ago · Juan Pablo Isaza Denunciar
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