Search

Insert Column

Last Updated: Dec 28, 2022

Articles

Use this function to insert an empty column at the given index positions in a worksheet.

Syntax

Insert Column (id_or_url, sheet_name_or_index , start_index, end_index, inherit_from_before, private_key, cient_email)

Parameters

Input Parameter Name Description
id_or_url ID or URL of Google Sheet
sheet_name_or_index Name or index of worksheet
start_index Start index of a column
end_index End index of a column
inherit_from_before Allowed inputs are:
  • True: Inherit properties from the previous column
    (In this case, the start index must be greater than 0)
  • False: inherit properties of next column
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, Columns inserted successfully
  • On Failure returns 0, Error Message

Sample

Insert Column (ABC123, Invoice, 2, 5, True, —–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, accesses the sheet Invoice using the ID ABC123 and inserts the columns 2 to 5 with the properties of the column 1.
    Returns Columns inserted successfully on inserting the columns.

To view all the Google Sheets functions, click here.

Did you find what you were looking for?