> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fetchski-attract.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Sheets

> Connect Google Sheets once, so any form can add each new submission to a spreadsheet as it arrives.

Connect Google Sheets once, and any form on your site can add each new submission to a Google Sheet as it arrives. It's handy when your team already works from a spreadsheet.

&#x20;**Who can do this:** Admins and Owners connect Google Sheets. Then anyone who can edit a form can choose its sheet.

## Before you start

* **A Google account** with access to Google Cloud, Google's site for developer tools. The steps are free.
* **The spreadsheets** you want submissions to go to, or a plan to create them.

## Connect Google Sheets

**1. Open the card**

Open **Connections** from the toolbar or the command palette (⌘K, or Ctrl+K on Windows). The toolbar is the bar across the top of your site once you're signed in; see [The toolbar](https://docs.fetchski-attract.com/guides/get-started/toolbar-and-command-palette.md#the-toolbar). Under **Google**, choose **Google Sheets**. Its badge says **Off**.

**2. Turn it on**

Set **Enable Google Sheets submissions** to **Yes**. The setup guide and the key box appear.

**3. Create a service account**

Follow **Setup guide — service account**. In Google Cloud, create a project, turn on the **Google Sheets API**, and create a service account. A service account is a robot Google account your site uses to write to your sheets.

**4. Download its key**

On the service account's **Keys** tab, choose **Add key** → **Create new key**. For the key type, keep Google's first choice: the plain-text kind that **Service account JSON** is named for. Download the key file. Google only lets you download it once, so keep it safe.

**5. Paste the key**

Open the key file in a text editor and copy all of its text, from the first `{` to the last `}`. Paste it into **Service account JSON** under the guide: the whole text, not the file's name or a single line.

**6. Save**

Choose **Save**. The badge reads **Connected**, with "Share each sheet with the service account to use it."

![The Google Sheets card connected: the Connected badge and its line "Share each sheet with the service account to use it.", Enable Google Sheets submissions on Yes.](https://mintcdn.com/fetchski-attract-api/MsE85fjBwOCKqNGh/images/cms/guides/connections/google-sheets/guides-connections-google-sheets-card-light.png?fit=max\&auto=format\&n=MsE85fjBwOCKqNGh\&q=85\&s=0d6d9e778c6d21aaa16a5fd7e9a3c2f5)

Google Sheets, connected.

## Share each sheet

Your site can only write to sheets you share with the service account.

**1. Find the service account's email address**

It's on the service account's page in Google Cloud, and in the key file. It ends in `iam.gserviceaccount.com`.

**2. Open the spreadsheet in Google Sheets and choose Share**

**3. Add that email address as an Editor, and send**

![The Google Sheets card's setup guide, whose step 4 says to share each spreadsheet with the service account's client\_email as an Editor.](https://mintcdn.com/fetchski-attract-api/tIdeo2aKESm5opj4/images/cms/guides/connections/google-sheets/guides-connections-google-sheets-share-light.png?fit=max\&auto=format\&n=tIdeo2aKESm5opj4\&q=85\&s=bff26d30d2c4807ce6eb16fd58d42f1f)

Share the sheet with the service account as an Editor.

## Choose a sheet for a form

Each form picks its own sheet, on its **After submission** tab: turn on **Submit to Google Spreadsheets**, then fill in two boxes.

* **Google Spreadsheet ID**: which spreadsheet file. It's the long code in the file's web address, between `/d/` and `/edit`.
* **Google Spreadsheet Sheet Name**: which tab inside that file, from the tabs along the bottom, such as **Sheet1**. Use the tab's name, not the file's.

See [Form submissions](https://docs.fetchski-attract.com/guides/forms/form-submissions.md) for the steps.

## Good to know

* **It works right away.** The connection is ready as soon as you save, with nothing to restart.
* **Every submission is still kept in the CMS.** If a sheet can't be reached, the submission is safe in [Form submissions](https://docs.fetchski-attract.com/guides/forms/form-submissions.md).
* **Submissions hold personal details.** Share the sheet only with people who need it.
* **To stop**, set **Enable Google Sheets submissions** to **No** and save.

## Troubleshooting

> [accordion] The badge says "Finish setting up
>
> The key isn't saved yet. The line under the badge says "Paste the service account key." Paste the whole key file into the key box, then choose **Save**.

> [accordion] Submissions don't appear in the sheet
>
> Check these in order:
>
> 1. The sheet is shared with the service account's email address as an **Editor**.
> 2. The **Google Sheets API** is turned on in the same Google Cloud project as the service account.
> 3. The form's **Google Spreadsheet ID** and **Google Spreadsheet Sheet Name** match the sheet and its tab.

> [accordion] I lost the key file
>
> Google can't send it again. Create a new key on the service account's **Keys** tab, then choose **Replace** on the card and paste the new file.

## Related

> [card] [Form submissions](https://docs.fetchski-attract.com/guides/forms/form-submissions.md)
>
> read, export and copy what your forms collect.

> [card] [Build a form](https://docs.fetchski-attract.com/guides/forms/build-a-form.md)
>
> create a form and put it on a page.

> [card] [Connections](https://docs.fetchski-attract.com/guides/connections/index.md)
>
> every outside service your site uses.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.