Search

Get Row Count

Last Updated: Mar 8, 2023

Articles

Use this function to get the row count of a sheet upto the last filled row.

If there is any empty row in between the filled rows then the empty row is added to the count too.

Syntax

Get Row Count (id_or_url, sheet_name_or_index , private_key, cient_email)

Parameters

Input Parameter Name Description
id_or_url ID or URL of Google Sheet
sheet_name_or_index Name or index of worksheet
private_key Private key of the service account
client_email Email ID of the service account

Returns

Return Value Description
Output
  • On Success returns 1, Row Count
  • On Failure returns 0, Error Message

Sample

Get Row Count (ABC123, Invoice, —–BEGIN PRIVATE KEY—–\nABCD\n—–END PRIVATE KEY—–, name@project-id.iam.gserviceaccount.com)

  • Uses the private key —–BEGIN PRIVATE KEY—–\nABCD\n—–END PRIVATE KEY—– to connect to the Email ID name@project-id.iam.gserviceaccount.com, accesses the sheet Invoice using the ID ABC123 and gives the row count of the filled cells.
    Returns the count 3 .

To view all the Google Sheets functions, click here.

Did you find what you were looking for?