2024-06-07 13:53:24 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 2
|
|
|
|
---
|
|
|
|
|
|
|
|
# Clear cells
|
|
|
|
Clears the value in cells
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
2024-06-07 23:40:04 +02:00
|
|
|
*Function ClearCells(Val Token, Val Spreadsheet, Val CellsArray, Val Sheet = "") Export*
|
2024-06-07 13:53:24 +02:00
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Destination |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Token |
|
2024-06-07 23:40:04 +02:00
|
|
|
| Spreadsheet | --spreadsheet | String | SpreadsheetID |
|
2024-06-07 13:53:24 +02:00
|
|
|
| CellsArray | --cells | Array of String | Array of cells like A1 to be cleared |
|
|
|
|
| Sheet | --sheetname | String | Sheet name (first sheet by default) |
|
|
|
|
|
|
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Google
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-06-07 13:53:24 +02:00
|
|
|
```bsl title="Code example"
|
|
|
|
|
|
|
|
CellsArray = New Array;
|
|
|
|
CellsArray.Add("B2");
|
|
|
|
CellsArray.Add("A3");
|
|
|
|
CellsArray.Add("B4");
|
|
|
|
|
2024-06-07 23:40:04 +02:00
|
|
|
Spreadsheet = "1Pu07Y5UiGVfW4fqfP7tcSQtdSX_2wdm2Ih23zlxJJwc";
|
2024-06-07 13:53:24 +02:00
|
|
|
Sheet = "Sheet2";
|
|
|
|
|
2024-06-07 23:40:04 +02:00
|
|
|
Response = OPI_GoogleSheets.ClearCells(Token, Spreadsheet, CellsArray, Sheet); //Map
|
2024-06-07 13:53:24 +02:00
|
|
|
Response = OPI_Tools.JSONString(Response); //JSON string
|
|
|
|
|
|
|
|
```
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
2024-06-07 13:53:24 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
|
|
|
|
|
|
|
oint gsheets ClearCells --token %token% --spreadsheet "1Pu07Y5UiGVfW4fqfP7tcSQtdSX_2wdm2Ih23zlxJJwc" --cells %cells% --sheetname "Sheet2"
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-07-10 10:59:55 +02:00
|
|
|
{
|
2024-06-07 13:53:24 +02:00
|
|
|
"spreadsheetId": "1Pu07Y5UiGVfW4fqfP7tcSQtdSX_2wdm2Ih23zlxJJwc",
|
|
|
|
"clearedRanges": [
|
|
|
|
"'Sheet2'!B2",
|
|
|
|
"'Sheet2'!A3",
|
|
|
|
"'Sheet2'!B4"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|