# Google sheets

# introduction

**Ver.** 17-10-2022

This plugin extracts the values of a cell, column or row, from a google sheet document.  
  
**Type:** Server plug-in

# Previous configuration

In console.cloud.google.com:

[![image-1666008066266.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-10/scaled-1680-/image-1666008066266.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-10/image-1666008066266.png)

<div id="bkmrk-you-must-choose-a-pr"><span class="HwtZe" lang="en"><span class="jCAhz ChMk0b"><span class="ryNqvb">You must choose a project or create a new one:</span></span></span></div>[![image-1666008365140.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-10/scaled-1680-/image-1666008365140.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-10/image-1666008365140.png)

<span class="HwtZe" lang="en"><span class="jCAhz ChMk0b"><span class="ryNqvb">The google drive API must be enabled, we can look for it in the "library" section.</span></span></span>

[![image-1666008470354.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-10/scaled-1680-/image-1666008470354.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-10/image-1666008470354.png)

<span class="HwtZe" lang="en"><span class="jCAhz ChMk0b"><span class="ryNqvb">Once enabled, in the credentials section, we must create a password for our service account:</span></span></span>

[![image-1666008590100.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-10/scaled-1680-/image-1666008590100.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-10/image-1666008590100.png)

<span class="HwtZe" lang="en"><span class="jCAhz ChMk0b"><span class="ryNqvb">A json file will be downloaded, once this is done the next thing will be to enable the google sheets API.</span></span></span>

[![image-1666008698072.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-10/scaled-1680-/image-1666008698072.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-10/image-1666008698072.png)

<span class="HwtZe" lang="en"><span class="jCAhz ChMk0b"><span class="ryNqvb">Once enabled, the last part will be to share the google sheets document with the project service account, the address is in the previously downloaded json:</span></span></span>

[![image-1666008827161.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-10/scaled-1680-/image-1666008827161.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-10/image-1666008827161.png)

# Parameters

<table border="1" id="bkmrk-par%C3%A1metro-descripci%C3%B3" style="height: 295px;"><tbody><tr style="height: 29px;"><td style="height: 29px; width: 147.986px;">Parameter</td><td style="height: 29px; width: 660px;">Description</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 147.986px;">--creds\_json</td><td style="height: 29px; width: 660px;">Path to the file with the credentials</td></tr><tr style="height: 46px;"><td style="height: 46px; width: 147.986px;">--creds\_base64</td><td style="height: 46px; width: 660px;">Base64-encoded credentials code.</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 147.986px;">--name</td><td style="height: 29px; width: 660px;">Name of the googlesheet document</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 147.986px;">--cell</td><td style="height: 29px; width: 660px;">The cell from which the data is expected, for example: "B1"</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 147.986px;">--row</td><td style="height: 29px; width: 660px;">Row number. Specified with a number, for example: 2</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 147.986px;">--column</td><td style="height: 29px; width: 660px;">Column number. Specified with a number, for example: 3</td></tr><tr style="height: 46px;"><td style="height: 46px; width: 147.986px;">--sheet</td><td style="height: 46px; width: 660px;">Name of the sheet in the document where the plugin will look. It must be exactly the same as the name it has, including spaces and capitalization, for example: "Sheet 1"</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 147.986px;">--onlydigits</td><td style="height: 29px; width: 660px;">Set to 1 to parse non-digit values</td></tr></tbody></table>

a

# Manual execution

```
./pandora_googlesheets --creds_json/creds_base64 <file credentials> --name <name document> --sheet <name-sheet> --cell <Number cell> --row <number-row> --column <number-column>
```

[![image-1683875273721.png](https://pandorafms.com/guides/public/uploads/images/gallery/2023-05/scaled-1680-/image-1683875273721.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2023-05/image-1683875273721.png)

If the onlydigits parameter is used, a non-digit value will be parsed:

```
./pandora_googlesheets --creds_json/creds_base64 <file credentials> --name <name document> --sheet <name-sheet> --cell <Number cell> --row <number-row> --column <number-column> onlydigits 1
```

[![image-1683813865590.png](https://pandorafms.com/guides/public/uploads/images/gallery/2023-05/scaled-1680-/image-1683813865590.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2023-05/image-1683813865590.png)