I'm using getDataRange().getValues() to copy data from a Google sheet to an array which I can work with.
i thought I had been successful and have been workng with several datasets in this manner until now, however I attempted to use filter() on the array without success. Stack Overflow informed me that the array is not valid (it's just a Javascript object, but not an array).
The format is like this:
[
[a1,a2,a3,a4],
[b1,b2,b3,b4],
[c1,c2.c3,c4]
]
Note the missing apostrophes around each value.
This is the code I'm using to create the object:
var allTrans = sheet.getDataRange().getValues();
What am I doing wrong? Is there away to get the sheet values into a valid array or does anyone have any suggestion on the best way to wrap each value into quotes, so I can use filter on it?
This is related to a question I asked earlier here.
Ideally, I'd like the structure of resulting array to the same as above, since I've already written nearly 1,000 lines of code accessing the array using alltrans[i][0] (etc.). Thanks,