> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-en/action-guides/google-service/read-google-sheet.md).

# Read google sheet

Reading a google sheet is the action of instructing the automation script to connect to your Google Drive account to extract and read content from a cell or a range of data in an online Google Sheets file.

#### Configuration parameters:

* Credential file: Select the Google account authentication file (the file with the `.json` extension). This file acts as a security key, intended to establish a secure connection with the Google API system, authenticate, and grant permission for GPM Automate to read/write content on your Google Sheet.
  * *Detailed instructions*: You can watch a video guide on how to create this authentication file here:
* File ID: The unique identifier of the Google Sheets file to interact with, allowing the system to accurately identify the file that needs to read data.
  * *How to get the ID*: When you open the Google Sheet file in your browser, the URL will look like `https://docs.google.com/spreadsheets/d/abc123xyz_ID_IS_HERE/edit`. You just need to copy the string located between `/d/` and `/edit` to fill in this field.
* Sheet ID: The index number of the sheet to read within the file (counted starting from `0` for the first sheet on the left, followed by 1, 2, 3... from left to right).
* Column Name or Index: Specify the column position to read data. You can enter in 2 ways:
  * *By letter name*: Enter the column name starting from `A`, `B`, `C`, `D`...
  * *By index number*: Enter the index number starting from `1` (corresponding to column 1 being column A).
* Row Index: The index number of the row to read data, counted starting from `1` (corresponding to row number 1 on Google Sheet).
* Output variable: The variable name of GPM Automate used to capture and store the value of the text content read from that cell.

#### Practical example: Automatically retrieving account data from Google Sheet to fill out a Form

When you store a list of multiple MMO accounts (including Username, Password) on a shared Google Sheet file, and want the script to automatically read the first row to retrieve data for processing:

* Configuration to retrieve Username from cell A1:
  * Credential file: Select the path to the `client_secret_....json` file you have configured.
  * File ID: Enter your Sheet file ID.
  * Sheet ID: `0` (Read from the first sheet).
  * Column Name or Index: Enter `A` (or enter `1`).
  * Row Index: Enter `1`.
  * Output variable: `currentUsername`
* Result: GPM Automate will silently connect to Google Sheet, extract data from cell A1, and load the text content directly into the variable `$currentUsername`. After that, you can smoothly call this variable in the Key press input action.

<figure><img src="/files/9mcGErMVgXER8h3qak5C" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/iQBcRO2dVpCKjHwikuGE" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-en/action-guides/google-service/read-google-sheet.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
