Search

Create Document

Last Updated: May 10, 2022

Articles

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

Syntax

Create Document (doc_name, private_key, client_email)

Parameters

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

Sample

Create Document (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 Doc with name Travel_Invoice.
    Returns the Document ID of the Google Doc created.

To view all the Google Docs functions, click here.

Did you find what you were looking for?