> For the complete documentation index, see [llms.txt](https://integrations.drivetrain.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integrations.drivetrain.ai/integration-guide/readme/spreadsheets/integrating-with-google-sheets.md). Agents can also search and read this documentation through its [MCP server](https://integrations.drivetrain.ai/~gitbook/mcp).

# Integrating with Google Sheets

Connect Google Sheets to Drivetrain and import spreadsheet data into financial models. Covers OAuth authorization and sheet selection.

Sign in with Google once, then add each tab you want as a dataset by pasting its URL.

### Before you start

* You're a Drivetrain **Admin**.
* You sign in with a **Google account that can open the sheets** you want to import. The sheets don't need to be public.
* Your Google Workspace allows **third-party app connections**.
* The file is a **native Google Sheet**, not an uploaded .xlsx file.

Drivetrain asks Google for **read-only access to your Google Sheets** (plus your name and email). It gets no access to other Google Drive files, and it only reads the tabs you add.

### Step 1: Connect your Google account

1. On the **Data** page, click the **+** icon next to **Data** and select **Google Sheets**.
2. Click **Connect Google Account** and sign in.
3. On Google's consent screen, tick **See all your Google Sheets spreadsheets** and click **Continue**.

You're returned to Drivetrain and the **Add data from Google Sheets** window opens.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-b94cfceec4de5f8808545de0613da4e2944aee35%2FGsheet0.gif?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
One connection per Google account. To import sheets that only another Google account can open, add a second Google Sheets connection signed in as that account.
{% endhint %}

### Step 2: Add a tab

1. In Google Sheets, open the tab you want to import.
2. Copy the URL from your browser's address bar. It must start with `https://docs.google.com/spreadsheets/d/` and include `#gid=`, which identifies the tab.
3. In Drivetrain, paste it into **Sheet URL** and click **Add**.

The tab appears as a dataset under the Google Sheets connection.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-980b84cd12253688cb0cae380d86b5fe840d8262%2FGsheet1.gif?alt=media" alt=""><figcaption></figcaption></figure>

To add more tabs, click **Add data** on the connection and repeat. Each URL adds one tab.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-c7e0e0a08fbf813a2a9162042fa74d528f21d899%2Fgsheet2.gif?alt=media" alt=""><figcaption></figcaption></figure>

### Format your sheet

* The table starts at **cell A1**, and **row 1** holds clear, unique column headers.
* Each tab holds **only one table**.
* Dates use `YYYY-MM-DD`, `YYYY/MM/DD`, `MM-DD-YYYY` or `MM/DD/YYYY`.

Drivetrain detects whether a tab is a **Transaction** or a **Time series** dataset:

* **Transaction:** each row is one record, such as a deal, invoice or journal entry.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-e4f37ef7b85f353c77759127f9365dcebd2ee5e5%2FScreenshot%202025-10-31%20at%205.17.47%E2%80%AFPM.png?alt=media" alt=""><figcaption></figcaption></figure>

* **Time series:** each row is one entity (customer, account, region), the first column holds its name or ID, and each period is its own column with a valid date header. Drivetrain unpivots it into rows.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-5a898bec227ae98c6722ccff2a93d26533212c48%2FScreenshot%202025-10-31%20at%205.16.38%E2%80%AFPM.png?alt=media" alt=""><figcaption></figcaption></figure>

### Syncing

Each sync re-reads every tab you added in full. Tabs sync automatically with your other data sources. To refresh now, open the connection's **⋮** menu and click **Sync**.

### Reconnect or disconnect

* **Reconnect** (for example after you revoke access in Google): open the connection's **⋮** menu, click **Edit credentials**, and sign in again. A full sync starts.
* **Disconnect:** open the connection's **⋮** menu and click **Remove**.

### Troubleshooting

<details>

<summary>Missing spreadsheet access. Check "See all your Google Sheets spreadsheets" and click Continue.</summary>

You left the Sheets permission unticked on Google's consent screen. Click **Grant access**, tick the box, and click **Continue**.

</details>

<details>

<summary>Invalid Google Sheet link. It must contain a sheet ID</summary>

The URL has no `#gid=`. Open the tab itself and copy the URL from the address bar, not from **Share → Copy link**.

</details>

<details>

<summary>&#x3C;your account> does not have access to this Google Sheet</summary>

The Google account you connected can't open the sheet. Share the sheet with that account, or connect a Google account that can open it.

</details>

<details>

<summary>XLSX files imported into Google Sheets aren’t supported</summary>

The file is an uploaded Excel file. Open it and use **File → Save as Google Sheets**, then add the new sheet's URL.

</details>

<details>

<summary>The sheet ID mentioned in the URL is invalid. Please check again.</summary>

The spreadsheet wasn't found. Check that the URL is complete and the file wasn't deleted.

</details>

<details>

<summary>Invalid Google Sheet URL. Please check the URL and try again</summary>

The `#gid=` in the URL doesn't match any tab, for example because the tab was deleted. Open the tab again and copy a fresh URL.

</details>

<details>

<summary>Sheet with the same name already exists.</summary>

A tab with the same spreadsheet name and tab name is already added to the connection. If it's the same tab, use **Sync** to refresh it; otherwise rename the spreadsheet or tab.

</details>

<details>

<summary>A Google Sheet instance with the account … already exists.</summary>

That Google account is already connected. Add more tabs with **Add data** on the existing connection.

</details>

<details>

<summary>The tab was added but the data looks wrong</summary>

Check the [format rules](#format-your-sheet): table at A1, headers in row 1, one table per tab, supported date formats.

</details>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://integrations.drivetrain.ai/integration-guide/readme/spreadsheets/integrating-with-google-sheets.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
