class SpreadsheetApp method .getValues()

SpreadsheetApp is the Apps Script service.

.getValues() is the method name you will see after a dot in your code.

What it does

Reads values from every cell in a range as a 2D array.

Why it's used

  • Load a whole table into memory to filter, sort, or send to an API.
  • Much faster than reading cells one at a time in a loop.

Common errors

  • Forgetting parentheses on getValues. Write SpreadsheetApp.getValues(), not SpreadsheetApp.getValues or getValues by itself.
  • Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').getValues().
  • Adding spaces where they do not belong. Write SpreadsheetApp.getValues(), not SpreadsheetApp .getValues(), SpreadsheetApp.getValues (), or SpreadsheetApp . getValues().
  • Wrong capitalization. Use SpreadsheetApp and getValues, not spreadsheetapp or getvalues.

Explore

Related methods

Better Sheets tutorials

2 New Ways To Add Emoji Reactions

2 New Ways To Add Emoji Reactions

 Revolutionize the way you react with emojis! Discover two new methods t...
Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet

Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet

Create a click Edit: Google changed how the redirect is handled. It no l...
Automate Form Response to Confirmation Email

Automate Form Response to Confirmation Email

Create an email automatically when someone fills out a google form. incl...
Automate Move Blank Rows

Automate Move Blank Rows

Automate the apps script we just created that moves blank rows from one ...

Related blog posts

Written guides about SpreadsheetApp.getValues().

Browse the blog