Search

Delete Content

Last Updated: Feb 14, 2022

Articles

Use this function to delete the text within the given indices in a Google Doc.

Syntax

Delete Content (document_id, start_index, end_index, private_key, client_email)

Parameters

Input Parameter Name Description
document_id Name of the document
start_index Starting index of text
end_index Ending index of text
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 deleted successfully
  • On Failure returns 0, Error Message

Sample

Delete Content (XYZ123, 2, 7, —–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, deletes the content between the indices 2 and 7 in the Google Doc with ID XYZ123.
    Returns Text deleted successfully after deleting the content.

To view all the Google Docs functions, click here.

Did you find what you were looking for?