Skip to main content

$integration.googleSheets.writeDataToCells

The method is used to write data to cells in a Google spreadsheet.

Syntax

The method accepts 4 required arguments.

ArgumentDescriptionType
integrationIdIntegration identifierString
spreadsheetIdGoogle spreadsheet identifierString
sheetNameThe name of the necessary sheetString
valuesThe data written to the spreadsheetArray of objects

Objects passed in the values array should have the following properties:

PropertyDescriptionType
valuesThe data written to the spreadsheetArray of strings
cellThe cell coordinatesString

An example of calling the method:

$integration.googleSheets.writeDataToCells(
"4404df16-bfc7-4bc6-9f84-65d02d000217",
"1gdkEwg2KMeKYJK-yrxgKuk9-uP7ntjtKg5ChDu8906E",
"Sheet1",
[{values: ["Carpenter", "78121770707"], cell: "C4"}]
);

Action

The method writes the values passed as arguments to the appropriate cells on the necessary sheet.

tip
If several values are passed in the values array, the second and any subsequent values are written to cells in columns adjacent to the cell required.
caution
In contrast to googleSheets.writeDataToLine, this method overwrites existing data if writing to cells that are not empty.

Example

This is an example of using the method for updating the client database.