Returns the starting row index of a range.
class SpreadsheetApp method .getRow()
SpreadsheetApp is the Apps Script service.
.getRow() is the method name you will see after a dot in your code.
What it does
Why it's used
- Figure out which row a cell sits on for row-based logic.
- Skip or highlight rows based on position in the sheet.
Common errors
- Forgetting parentheses on getRow. Write SpreadsheetApp.getRow(), not SpreadsheetApp.getRow or getRow by itself.
- Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').getRow().
- Adding spaces where they do not belong. Write SpreadsheetApp.getRow(), not SpreadsheetApp .getRow(), SpreadsheetApp.getRow (), or SpreadsheetApp . getRow().
- Wrong capitalization. Use SpreadsheetApp and getRow, not spreadsheetapp or getrow.
7 Snippets using this methods
- Basic CRM - Add a Powerful Script To Move Row Based on Status: Code.gs
- Automatically Check Past Stages: Code.gs
- Automate Form Response to Confirmation Email: Code.gs
- Automate Google Sheets With Zero Experience: Code.gs
- Automate Help Desk Ticket Closing: Code.gs
- Automated Project Management in Google Sheets: Code.gs
- Add Tasks to Google Tasks From Google Sheets: Code.gs
Explore
Related methods
-
.getColumn()
Returns the starting column index of a range.
-
.getRange()
Returns a range of cells by A1 notation or row and column numbers.
-
.getNumRows()
Returns how many rows are in a range.
-
.offset()
Returns a range shifted by a number of rows and columns.
-
.getLastRow()
Returns the row number of the last row that has content.
More Apps Script
7 Better Sheets tutorials
Add Tasks to Google Tasks From Google Sheets
Automated Project Management in Google Sheets
Automate Form Response to Confirmation Email
Automate Google Sheets With Zero Experience
Automatically Check Past Stages
Basic CRM - Add a Powerful Script To Move Row Based on Status
Related blog posts
Written guides about SpreadsheetApp.getRow().
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 →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 →How to reference a different Google Spreadsheet in Apps Script?
Transferring Data Between Cells in Different Spreadsheets
Read post →