Skip to main content

Clear cells

Clears the value in cells

Function ClearCells(Val Token, Val Spreadsheet, Val CellsArray, Val Sheet = "") Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Spreadsheet--spreadsheetStringSpreadsheetID
CellsArray--cellsArray of StringArray of cells like A1 to be cleared
Sheet--sheetnameStringSheet name (first sheet by default)

Returns: Map Of KeyAndValue - serialized JSON response from Google


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);
    oint gsheets ClearCells \
--token "***" \
--spreadsheet "1yZl0UlB5C_vDL5hoNYRJjUKAB4-JPmzB46M7RNsJUuI" \
--cells "['B2','A3','B4']" \
--sheetname "Sheet2"
Result
{
"spreadsheetId": "1p_i-5lmOKdBEbi88O0SkXq2Q_gG0c4EY7N_wtWGKSCs",
"clearedRanges": [
"Sheet2!B2",
"Sheet2!A3",
"Sheet2!B4"
]
}