0

I'm using Google Script and am retrieving records from various tables in sheets and am trying to figure out some elegant ways that the framework will allow for this, without writing something from scratch myself. It seems that according to the following post, there isn't the functionality within Google Apps Script to directly utilize the filter functions that exist in the sheets themselves:

google spreadsheet script - Enable filter with a range by script

So, if this is the case, what are people turning to in order to perform the functions of filtering and sorting data within Google Script?

Thank you, Nicholas Kincaid

Community
  • 1
  • 1
nbkincaid
  • 107
  • 1
  • 1
  • 9

1 Answers1

2

When you read a range (or an entire sheet which is also a range) using getValues(), you get an array of arrays (a array of rows data, each row data being an array of cell values).

You can use all the JavaScript Array methods to sort, reverse, slice, shift... data in this array. See documentation here or here.

Serge insas
  • 45,904
  • 7
  • 105
  • 131