Reads the value stored in a single cell.
class SpreadsheetApp method .getValue()
SpreadsheetApp is the Apps Script service.
.getValue() is the method name you will see after a dot in your code.
What it does
Why it's used
- Read a single setting cell, status flag, or lookup key.
- Check one cell before deciding what the rest of the script should do.
Common errors
- Forgetting parentheses on getValue. Write SpreadsheetApp.getValue(), not SpreadsheetApp.getValue or getValue by itself.
- Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').getValue().
- Adding spaces where they do not belong. Write SpreadsheetApp.getValue(), not SpreadsheetApp .getValue(), SpreadsheetApp.getValue (), or SpreadsheetApp . getValue().
- Wrong capitalization. Use SpreadsheetApp and getValue, not spreadsheetapp or getvalue.
Snippets using this method
- Automatic Calculations
- Automated Project Management in Google Sheets
- Add Tasks to Google Tasks From Google Sheets
- Add A Timestamp to Task Lists (without Now Formula)
- Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet
- Access the Dictionary API to get Definitions for Words in Google Sheets
- 2 New Ways To Add Emoji Reactions
- 5 Ways To Use Google Sheets for Advanced Project Management
- 2 New Ways To Add Emoji Reactions
Explore
Related methods
-
.setValue()
Writes a value into a single cell.
-
.getValues()
Reads values from every cell in a range as a 2D array.
-
.getDisplayValue()
Reads the formatted text shown in a cell, not the raw value.
-
.getDisplayValues()
Reads the formatted text shown in every cell in a range.
-
.setValues()
Writes a 2D array of values into a range of cells.
More Apps Script
Better Sheets tutorials
2 New Ways To Add Emoji Reactions
Access the Dictionary API to get Definitions for Words in Google Sheets
Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet
Add Tasks to Google Tasks From Google Sheets
Automated Project Management in Google Sheets
Automate Emails
Related blog posts
Written guides about SpreadsheetApp.getValue().
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 →Explore Coding in Google Sheets
Did you know you can actually code in Google Sheets?
Read post →