Reads the formatted text shown in every cell in a range.
class SpreadsheetApp method .getDisplayValues()
SpreadsheetApp is the Apps Script service.
.getDisplayValues() is the method name you will see after a dot in your code.
What it does
Why it's used
- Export a range exactly as it appears on screen.
- Build PDFs or emails that mirror the sheet formatting.
Common errors
- Forgetting parentheses on getDisplayValues. Write SpreadsheetApp.getDisplayValues(), not SpreadsheetApp.getDisplayValues or getDisplayValues by itself.
- Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').getDisplayValues().
- Adding spaces where they do not belong. Write SpreadsheetApp.getDisplayValues(), not SpreadsheetApp .getDisplayValues(), SpreadsheetApp.getDisplayValues (), or SpreadsheetApp . getDisplayValues().
- Wrong capitalization. Use SpreadsheetApp and getDisplayValues, not spreadsheetapp or getdisplayvalues.
Explore
Related methods
-
.getDisplayValue()
Reads the formatted text shown in a cell, not the raw value.
-
.getValues()
Reads values from every cell in a range as a 2D array.
-
.getValue()
Reads the value stored in a single cell.
-
.clearFormat()
Removes only formatting from a range, keeping values.
-
.clearContent()
Removes only cell values from a range, keeping formatting.
More Apps Script
Better Sheets tutorials
No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.
Related blog posts
Written guides about SpreadsheetApp.getDisplayValues().
How to Use Google Sheets as a Website Database
Did you know you can use Google Apps Script to turn a Google Sheet into a free, auto-syncing database for your website? This guide shows you exactly how to set it up. You’ll prepare your spreadsheet, write a few lines of code and publish your site. Don’t worry if you’re not a developer, we’ll walk you through it. Why Use Google Sheets as a Database? For small projects, Google Sheets offers many advantages over traditional databases: * Free hosting and storage * Easy to edit data without...
Read post →Getting Started in Google Sheets Spreadsheet Management
Users can also customize the appearance of their spreadsheets with different fonts, colors, and themes.
Read post →Explore Coding in Google Sheets
Did you know you can actually code in Google Sheets?
Read post →