Search

Insert Text

Last Updated: Feb 14, 2022

Articles

Use this function to insert the text from the specified index in the Google Doc.

Only text content can be inserted. Table content is not allowed.

Syntax

Insert Text (document_id, index_position, text_value, private_key, client_email)

Parameters

Input Parameter Name Description
document_id Name of the document
index_position Index to insert the text
text_value Text to be inserted
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, Text inserted successfully
  • On Failure returns 0, Error Message

Sample

Insert Text (XYZ123, 3, Travel, —–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, inserts the text Travel at the index 3 in the Google Doc with ID XYZ123.
    Returns Text inserted successfully after inserting the text.

To view all the Google Docs functions, click here.

Did you find what you were looking for?