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

141
Vistas
typeerror cannot read property 'length' of undefined app script

Hi I am trying to use this code to import a JSON file from API I keep getting this error "TypeError: Cannot read property 'length' of undefined"

PIVOT_URL_Country = ""
SHEET_NAME_Country = "test"

function updateDataCountry() {
const response = JSON.parse(UrlFetchApp.fetch(PIVOT_URL_Country))
const headers = [response.headers]
const data = response.report
const output = headers.concat(data)
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(SHEET_NAME_Country)
sheet.getDataRange().clearContent()
sheet.getRange(1, 1, output.length, output[0].length).setValues(output)
}

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