Search

Update A Cell

Last Updated: May 10, 2022

Articles

Use this function to update a value in a particular cell by using row-column index in a given worksheet.

Syntax

Update A Cell (id_or_url, sheet_name_or_index , row_index, col_index, value, 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
row_index Index of a Row
col_index Index of a Column
value Value to be updated
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, Cell value is updated
  • On Failure returns 0, Error Message

Sample

Update Cells (ABC123, Invoice, 1, 2, 1234, —–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 updates the cell at the row 1 and column 2 with the value 1234.
    Returns Cell value is updated on updating the cell.

To view all the Google Sheets functions, click here.

Did you find what you were looking for?