1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-12-05 22:53:35 +02:00
Files
OpenIntegrations/docs/en/md/Google_Sheets/Data-management/Clear-cells.mdx
Vitaly the Alpaca (bot) 60ddd5e71e Main build (Jenkins)
2025-05-21 10:35:46 +03:00

80 lines
2.2 KiB
Plaintext
Vendored

---
sidebar_position: 2
description: Clear cells and other functions to work with Google Sheets in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Google Sheets]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Clear cells
Clears the value in cells
`Function ClearCells(Val Token, Val Spreadsheet, Val CellsArray, Val Sheet = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Token |
| Spreadsheet | --spreadsheet | String | ✔ | SpreadsheetID |
| 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
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Token = "ya29.a0AW4XtxhtghlL7aK7VhJX0jOgNWau4CUoOEDkQBr4uJEjPidCjKm-4r4l7AoJnODBt7yblowJtvv_3vETd6CulW4V5zxxPx8TTvQAMESj7...";
Spreadsheet = "15pyer8RapTluc4feiD8_y1P42RVoDG5xBDly6IPC-OE";
Sheet = "Sheet2";
CellsArray = New Array;
CellsArray.Add("B2");
CellsArray.Add("A3");
CellsArray.Add("B4");
Result = OPI_GoogleSheets.ClearCells(Token, Spreadsheet, CellsArray, Sheet);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint gsheets ClearCells \
--token "***" \
--spreadsheet "1yZl0UlB5C_vDL5hoNYRJjUKAB4-JPmzB46M7RNsJUuI" \
--cells "['B2','A3','B4']" \
--sheetname "Sheet2"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint gsheets ClearCells ^
--token "***" ^
--spreadsheet "1yZl0UlB5C_vDL5hoNYRJjUKAB4-JPmzB46M7RNsJUuI" ^
--cells "['B2','A3','B4']" ^
--sheetname "Sheet2"
```
</TabItem>
</Tabs>
```json title="Result"
{
"spreadsheetId": "1p_i-5lmOKdBEbi88O0SkXq2Q_gG0c4EY7N_wtWGKSCs",
"clearedRanges": [
"Sheet2!B2",
"Sheet2!A3",
"Sheet2!B4"
]
}
```