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

44
Views
Header row values not saving into array

Here's my table: https://docs.google.com/spreadsheets/d/1QsP9zWOZHretwohq5e_2puQl0V0IMKHa-E-NJtBU4B4/edit?usp=sharing

I'm trying to put all values of the first row (the headers) into an array using this code:

for(let i=0;i<Cimiteri.length;i++)
  {
    var copySheet=as.getSheetByName('Date '+Cimiteri[i]);
    var ValoriA = copySheet.getRange(1,1,copySheet.getLastColumn()-1).getDisplayValues();
    for(let k=0;k<ValoriA.length-1;k++)
    {
      Logger.log(ValoriA[k]);
    }  

The problem is, some of my headers are not beign saved inside the array, "date in ordine" and "20/09/2021 Occupati" are skipped and I can't figure out why.

Edit: A cup of coffee later:

for(let i=0;i<Cimiteri.length;i++)
  {
    var copySheet=as.getSheetByName('Date '+Cimiteri[i]);
    var ValoriA = copySheet.getRange(1,1,1,copySheet.getLastColumn()-1).getDisplayValues().flat();
    for(let k=0;k<ValoriA.length-1;k++)
    {
      Logger.log(ValoriA[k]);
    }  
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Remove the loop and just look at:

Logger.log(JSON.stringify(copySheet.getRange(1,1,copySheet.getLastRow(),copySheet.getLastColumn() -1).getDisplayValues();)):
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!