Overview
Usesheet.getRows() to query rows from any sheet with filtering and sorting.
Object with
where (filters) and orderBy (sorting) arraysMaximum rows to return
Filtering with where
The where array contains filter conditions. Use cell filters for column values or row filters for metadata.
- Cell Filter
- Row Filter
Filter by column values:Operators:
| Operator | Description | Example Value |
|---|---|---|
eq / neq | Equal / Not equal | "active" |
lt / lte | Less than (or equal) | 100 |
gt / gte | Greater than (or equal) | 50 |
between | Range (use value + value2) | 10, 20 |
in | Match any in array | ["a", "b", "c"] |
contains | Text contains | "corp" |
starts_with / ends_with | Text prefix/suffix | "https://" |
is_empty / is_not_empty | Null check | — |
Sorting with orderBy
The orderBy array specifies sort order. Multiple sorts are applied in sequence.
- Cell Sort
- Row Sort
Sort by column values:
Examples
Filter by text column
Filter by text column
Filter + sort by date
Filter + sort by date
Filter by row run status
Filter by row run status
Multiple filters (AND logic)
Multiple filters (AND logic)