Reads values from every cell in a range as a 2D array.
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
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.
Snippets using this method
- Simple Inventory Management Automations
- Spreadsheet Automation for Beginners
- Shaman: AI Blog Writer
- Shaman: AI Blog Writer
- SOLUTIONS! Solve The Errors, Learn For Loop
- Tag Emails From A List of Members in Google Sheets
- Twitter App Clone in a Google Sheet
- Sheet Stories / Video Notes + Clear 24 Hour Old Videos
- Quickly Build a Daily Random Motivational Quote Website
- Saving OpenAI API Calls inside of Google Sheets
- I Created an Automatic Emailer
- Move Blank Rows
- OpenAI API Prompt with Array of Cells
- Idea Graveyard - Create a Decaying Checklist
- Laziest Checklist Ever
- Onboarding Scheduler
- MicroManager: Hourly Email Reminders
- Manage Your Wedding Guest List in Google Sheets
- LinkTree in a Google Sheet
- How To Format Sheets for Notes
- How To Send Two Emails in Same Trigger
- How to Turn Background Color to Text
- How to Power Testimonials with Google Forms and Sheets
- Google Maps Scraper for Outreach
Explore
Related methods
-
.setValues()
Writes a 2D array of values into a range of cells.
-
.getDisplayValues()
Reads the formatted text shown in every cell in a range.
-
.getValue()
Reads the value stored in a single cell.
-
.getRange()
Returns a range of cells by A1 notation or row and column numbers.
-
.getDisplayValue()
Reads the formatted text shown in a cell, not the raw value.
More Apps Script
Better Sheets tutorials
2 New Ways To Add Emoji Reactions
Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet
Automate Form Response to Confirmation Email
Automate Move Blank Rows
Brighten Up Your Checklist Automatically
Build a License Key Generator and API in 20 Minutes
Can I Automatically Rename a Sheet based on a Date?
Create an Automated Task List
Create a Tracking Number Fetcher with Google Sheets and Google Sites
Create Your Own Pride Flag Easter Egg in Sheets
Dylan Asks: How to Automatically Delete Rows If Cell Contains Value
Email Certain Department Based on Google Form Entries
Email Myself a Daily Random Motivational Quote
Embed Quote and Author to Daily Quote Website
Fast FAQS
Google Maps Scraper for Outreach
Hold a Giveaway Raffle in a Google Sheet
How To Format Sheets for Notes
How To Send Two Emails in Same Trigger
How to Turn Background Color to Text
I Created an Automatic Emailer
Idea Graveyard - Create a Decaying Checklist
Laziest Checklist Ever
LinkTree in a Google Sheet
MicroManager: Hourly Email Reminders
Move Blank Rows
Onboarding Scheduler
OpenAI API Prompt with Array of Cells
Quickly Build a Daily Random Motivational Quote Website
Saving OpenAI API Calls inside of Google Sheets
Shaman: AI Blog Writer
Simple Inventory Management Automations
SOLUTIONS! Solve The Errors, Learn For Loop
Solve The Errors, Learn For Loop
Tag Emails From A List of Members in Google Sheets
Related blog posts
Written guides about SpreadsheetApp.getValues().
How to reference a different Google Spreadsheet in Apps Script?
Transferring Data Between Cells in Different Spreadsheets
Read post →What's Better Than Google Sheets?
Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →Getting Started Coding in Apps Script
What you need to know to access Apps Script inside Google Sheets. Code in Google Scripts. Automate business processes and more.
Read post →