Get cell values
Gets cell values of the table
- Parameters
- Advanced call ?
Function GetCellValues(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 A1 type cells to get (whole sheet if not filled) |
| Sheet | --sheetname | String | ✖ | Sheet name (first sheet by default) |
Returns
Map Of KeyAndValue - serialized JSON response from Google
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
1C:Enterprise/OneScript code example
Token = "ya29.a0ATi6K2sWW_31WLH0d9aK0qk0HJ-UfyvZDcLeBbF5bLU7QH09Bx2pXAupIw40USQVaxXqsovItVSt9swWuPdBDSA0eFaVPE0CbaU2OLQlyrnITI1VVXgZ_Gx2R...";
Spreadsheet = "1hAKnTEvhiX-_-fYfXXYthJ3xq6Ub4SrlLPaIg0Tb9fs";
Sheet = "Sheet2";
CellsArray = New Array;
CellsArray.Add("B2");
CellsArray.Add("A3");
CellsArray.Add("B4");
Result = OPI_GoogleSheets.GetCellValues(Token, Spreadsheet, CellsArray, Sheet);
- Bash
- CMD/Bat
oint gsheets GetCellValues \
--token "***" \
--spreadsheet "1Dz51_uVHvmmRAOoPNLcfEV3Xzp9PoJTxAPQhrTFSdd0" \
--sheetname "Sheet2"
oint gsheets GetCellValues ^
--token "***" ^
--spreadsheet "1Dz51_uVHvmmRAOoPNLcfEV3Xzp9PoJTxAPQhrTFSdd0" ^
--sheetname "Sheet2"
Result
{
"spreadsheetId": "1Dz51_uVHvmmRAOoPNLcfEV3Xzp9PoJTxAPQhrTFSdd0",
"valueRanges": [
{
"range": "Sheet2!B2",
"majorDimension": "ROWS",
"values": [
[
"ThisIsB2"
]
]
},
{
"range": "Sheet2!A3",
"majorDimension": "ROWS",
"values": [
[
"ThisIsA3"
]
]
},
{
"range": "Sheet2!B4",
"majorDimension": "ROWS",
"values": [
[
"ThisIsB4"
]
]
}
]
}