﻿---
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Get cell values
 Gets cell values of the table



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

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Token |
  | Spreadsheet | --spreadsheet | String | &#x2714; | SpreadsheetID |
  | CellsArray | --cells | Array of String | &#x2716; | Array of A1 type cells to get (whole sheet if not filled) |
  | Sheet | --sheetname | String | &#x2716; | 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.a0AeDClZCVfxXCE-JAcPJed8p82WT_K0Jtttw0mCwT02IVORX3qB2e7AM-8OQCJa8ImTUNCA5F--f_CULx1mArjs-Se30Fonbdtroe7NaOe...";
    Spreadsheet = "1sop204zegJKdSBspxzJHBlGoaCa05__9cT7ivebrAwQ";
    Sheet       = "Sheet2";

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

    Result = OPI_GoogleSheets.GetCellValues(Token, Spreadsheet, CellsArray, Sheet);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint gsheets GetCellValues \
             --token "***" \
             --spreadsheet "1Fdxm8RQAiGfr30TI7pqVvVs5HpLlyjygP9iPardXQzc" \
             --sheetname "Sheet2"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint gsheets GetCellValues ^
             --token "***" ^
             --spreadsheet "1Fdxm8RQAiGfr30TI7pqVvVs5HpLlyjygP9iPardXQzc" ^
             --sheetname "Sheet2"
        ```
    </TabItem>
</Tabs>


```json title="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"
    ]
   ]
  }
 ]
}
```
