$integration.googleSheets.deleteRowOrColumn
The method is used to delete data in lines or columns from a Google spreadsheet.
Syntax
The method accepts 4 required arguments.
Argument | Description | Type |
---|---|---|
integrationId | Integration identifier | String |
spreadsheetId | Google spreadsheet identifier | String |
sheetName | The name of the necessary sheet | String |
values | The lines or the columns to be deleted | Array of strings |
An example of calling the method:
- ECMAScript 5
- ECMAScript 6
$integration.googleSheets.deleteRowOrColumn(
"5a9f649c-bdc4-4805-92c4-7bed80f7c285",
"1OysnSRFIBTWgVWEX1wYndSLgSZ3umznXR96v0vTh8Hg",
"Sheet2",
["H:H", "5:6"]
);
In the ECMAScript 6 runtime, the method is asynchronous.
await $integration.googleSheets.deleteRowOrColumn(
"5a9f649c-bdc4-4805-92c4-7bed80f7c285",
"1OysnSRFIBTWgVWEX1wYndSLgSZ3umznXR96v0vTh8Hg",
"Sheet2",
["H:H", "5:6"]
);
Action
The method deletes lines, columns, or a range of lines or columns in the necessary sheet.
tip
When deleting a line from a spreadsheet, other lines move up. When deleting a column, other columns shift left.
Specify a range of lines or columns you want to delete as follows:
- To delete a line, specify a range as
n:n
wheren
is a number of the line to be deleted. For example, if you want to delete the first line, write1:1
. - To delete a column, specify a range as
A:A
whereA
is a letter for the column to be deleted. - To delete multiple contiguous lines, specify a range as
n:m
wheren
is the first line andm
is the last line to be deleted. For example, if you want to delete the lines from the first to the third one, write1:3
. - To delete multiple contiguous columns, specify a range as
A:C
whereA
is the first column andC
is the last column to be deleted.
The method also allows deleting multiple lines and columns that are not contiguous.
Example
In the video below, we delete a client from the spreadsheet.