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

Returns the starting row index of a range.

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.

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.

7 Better Sheets tutorials

Add Tasks to Google Tasks From Google Sheets

Add Tasks to Google Tasks From Google Sheets

Create tasks in Google Tasks from Google Sheets using Apps Script
Automated Project Management in Google Sheets

Automated Project Management in Google Sheets

Create automatic notifications when a project is assigned, a project nee...
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 Google Sheets With Zero Experience

Automate Google Sheets With Zero Experience

By the end of this video you should be knowledgeable about how to automa...
Automate Help Desk Ticket Closing

Automate Help Desk Ticket Closing

Create a simple automated help desk ticketing system. • Create tickets C...
Automatically Check Past Stages

Automatically Check Past Stages

Create an automation that runs whenver we check off a checklist item the...
Basic CRM - Add a Powerful Script To Move Row Based on Status

Basic CRM - Add a Powerful Script To Move Row Based on Status

we're going to be adding a very powerful script to our CRMs or any datab...

Related blog posts

Written guides about SpreadsheetApp.getRow().

Browse the blog