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

387
Vistas
TypeError: no se puede leer la propiedad 'getRow' de Google Script nulo

Recibo un TypeError cuando ejecuto esto. no puedo entender porque..

 function iceHorsepowerInjector() { let z = 0; let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('blah blah blah'); let sheet1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('blah blah blah') let sheet2 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('blah blah blah') for (let i = 2; i <= 1312; i++) { let handle = sheet.getRange("A"+[i]).getValue(); if (handle == null){ continue; } else { var index = sheet1.createTextFinder(handle).matchEntireCell(true).findNext().getRow(); // <---- this is where I am getting the error } if (handle == null){ continue; } index = parseInt(index); let horsepower = sheet1.getRange("EE"+[index]).getValue(); if (horsepower == "NULL"){ continue; } let id = sheet.getRange("CQ"+[i]).getValue(); if (id == "#N/A"){ continue; } var commands = ("UPDATE fossil_fuel_vehicle_trims SET horsepower" + "=" + "'"+horsepower+ "' WHERE id =" + handle +";") sheet2.getRange(1+z,1).setValue(commands); //set to last row used in sheet3 z = z + 1 } }

este es el error..

 TypeError: Cannot read property 'getRow' of null iceHorsepowerInjector @ Code.gs:11

¿Cómo puedo solucionar esto? Siento que estoy cerca, pero parece que no puedo entender por qué sucede esto.

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

0

El error ocurre porque sheet1.createTextFinder(handle).matchEntireCell(true).findNext() devolvió un valor nulo.

Una solución simple para este error es reemplazar

 var index = sheet1.createTextFinder(handle).matchEntireCell(true).findNext().getRow(); // <---- this is where I am getting the error } if (handle == null){ continue; }

por

 var found = sheet1.createTextFinder(handle).matchEntireCell(true).findNext(); } if (found == null){ continue; } var index = found.getRow();
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