Search

Get Text Index

Last Updated: Feb 14, 2022

Articles

Use this function to give the list of indices that represent the location of the given text in the Google Doc.

Syntax

Get Text Index (document_id, text, private_key, client_email)

Parameters

Input Parameter Name Description
document_id Name of the document
text Text to get the index
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, String indices
  • On Failure returns 0, Error Message

Sample

Get Text Index (XYZ123, 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, looks for the location of the text Invoice in the Google Doc with ID XYZ123.
    Returns 1, 3, 9.

To view all the Google Docs functions, click here.

Did you find what you were looking for?