Search

Get Worksheets

Last Updated: Feb 14, 2022

Articles

Use this function to list the names of all the worksheets in a given Google Sheet.

Syntax

Get Worksheets (id_or_url, private_key, cient_email)

Parameters

Input Parameter Name Description
id_or_url ID or URL of Google Sheet
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, Worksheet Names
  • On Failure returns 0, Error Message

Sample

Get Worksheets (ABC123, —–BEGIN PRIVATE KEY—–\nABCD\n—–END PRIVATE KEY—–, name@project-id.iam.gserviceacValues.com)

  • Uses the private key —–BEGIN PRIVATE KEY—–\nABCD\n—–END PRIVATE KEY—– to connect to the Email ID name@project-id.iam.gserviceacValues.com, lists the names of all the worksheets using the ID ABC123.
    Returns the values Travel, Expenses, Invoice.

To view all the Google Sheets functions, click here.

Did you find what you were looking for?