Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

334
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!