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

330
Vistas
AppScript Array Filter (String) not filtering empty values

Trying to filter out empty values from getRange values but still giving me all data. I've tried the following but still not what I expected.

Data array logs the following: 123,,,444,,,331,323,,,,,,5443

var list = source.getRange("sheet!A1:J1:).getValues().filter(String);

or using callback function

list.filter(function(f) {return f[0] !=='';})

Result is still the same 123,,,444,,,331,323,,,,,,5443 What did I missed here?

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

0

After your comment i am not sure if the data you get is an array or an string:

Data array logs the following: 123,,,444,,,331,323,,,,,,5443

For the array case: [123,,,444,,,331,323,,,,,,5443]

const list = [123,,,444,,,331,323,,,,,,5443]
const result = list.filter(Boolean)

console.log(result)

For the string case: 123,,,444,,,331,323,,,,,,5443

const list = '123,,,444,,,331,323,,,,,,5443'
const result = list.split(',').filter(Boolean).map(Number)

console.log(result)

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