Skip to main content

Get cell values

Gets cell values of the table

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

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Spreadsheet--spreadsheetStringSpreadsheetID
CellsArray--cellsArray of StringArray of A1 type cells to get (whole sheet if not filled)
Sheet--sheetnameStringSheet name (first sheet by default)

Returns: Map Of KeyAndValue - serialized JSON response from Google


1C:Enterprise/OneScript code example
    Token       = "ya29.a0ARW5m7702-Ib_bOq69krqD5iUx89SC2lxGPxRJoBjqvSBqE7uKghOyAjwrL7ebNf6xqPzwD4wQfZlFvBrb7QsWlw5PGW_SvkFr57Y8Js...";
Spreadsheet = "1DoHoA-PGU3xsThA9Uh_rb_oHNpCXhKH0DkirmHTIo9I";
Sheet = "Sheet2";

CellsArray = New Array;
CellsArray.Add("B2");
CellsArray.Add("A3");
CellsArray.Add("B4");

Result = OPI_GoogleSheets.GetCellValues(Token, Spreadsheet, CellsArray, Sheet);
    oint gsheets GetCellValues \
--token "***" \
--spreadsheet "1dN30zu99-Z_s0h0XVFANq2SZnfnhrewgLwM71VBIMdQ" \
--sheetname "Sheet2"
Result
{
"spreadsheetId": "1p_i-5lmOKdBEbi88O0SkXq2Q_gG0c4EY7N_wtWGKSCs",
"valueRanges": [
{
"range": "Sheet2!B2",
"majorDimension": "ROWS",
"values": [
[
"ThisIsB2"
]
]
},
{
"range": "Sheet2!A3",
"majorDimension": "ROWS",
"values": [
[
"ThisIsA3"
]
]
},
{
"range": "Sheet2!B4",
"majorDimension": "ROWS",
"values": [
[
"ThisIsB4"
]
]
}
]
}