Search

Create GSheet

Last Updated: Feb 14, 2022

Articles

Use this function to create a new Google Sheet with the provided name in the drive.

Syntax

Create GSheet (title, private_key, client_email)

Parameters

Input Parameter Name Description
title Name of the 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, Spreadsheet ID
  • On Failure returns 0, Error Message

Sample

Create GSheet (Travel_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, creates a Google Sheet with name Travel_Invoice.
    Returns the Spreadsheet ID of the sheet created.

To view all the Google Sheets functions, click here.

Did you find what you were looking for?