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]);
}
Remove the loop and just look at:
Logger.log(JSON.stringify(copySheet.getRange(1,1,copySheet.getLastRow(),copySheet.getLastColumn() -1).getDisplayValues();)):