# Google Service Account

You can connect Tability to a Google Service Account to centralise the data connectors for Google Sheets and BigQuery. Once that your service account is connected, you can simply give it access to specific BigQuery and Google Sheets data that need to be accessible by Tability users.

## Privacy

Tability's use and transfer of information received from Google APIs to any other app will adhere to[ Google API Services User Data Policy](https://developers.google.com/terms/api-services-user-data-policy#additional_requirements_for_specific_api_scopes), including the Limited Use requirements.

## How to create a Google Service Account

1. Go to Google Cloud Console.
2. Create (or select) a project.
3. **Enable APIs**:
   * Search for **Google Sheets API** and enable it.
4. **Create a Service Account**:
   * Go to **IAM & Admin → Service Accounts → Create Service Account**.
   * Give it a name (e.g., `tability-integration`).
5. Create a **JSON key**:
   * In the Service Account’s **Keys** tab → **Add Key → Create new key → JSON**.
   * Download the JSON file (you’ll use it for the integration with Tability).

## How to connect the service account to Tability

1. Go to your workspace in Tability
2. Go to **Settings > Integrations**
3. Click on **Connect to Google Service Account**
4. Paste your JSON key and save

<figure><img src="/files/3ELFv5iYrLiKL6wcBFoj" alt=""><figcaption></figcaption></figure>

## **How to give your service account access to a Google Sheet**

The service account has an email like `my-service@my-project.iam.gserviceaccount.com`

1. Open your Google Sheet in the browser.
2. Share it **exactly like you would to a person** — paste that email in “Share with” and give it viewer permission

## How to give your service account access to a BigQuery project

### Enable the BigQuery API

1. In Google Cloud Console, make sure you’re in the correct project.
2. Go to **APIs & Services → Library**.
3. Search for **BigQuery API** and click **Enable**.

### Granting project-level roles

1. Navigate to **IAM & Admin → IAM**.
2. Click **+ Grant Access**.
3. Enter the **service account email** (e.g. `my-service@my-project.iam.gserviceaccount.com`).
4. Under **Select a role**, choose:
   * **BigQuery Job User** (`roles/bigquery.jobUser`) → allows running queries.
   * Optionally, **BigQuery User** (`roles/bigquery.user`) → allows creating datasets.
   * Or **BigQuery Admin** (`roles/bigquery.admin`) if you want full control.
5. Click **Save**.

### Granting dataset-level access

Project-level roles let the service account run jobs, but you also need dataset permissions so it can read/write data.

1. Go to **BigQuery** in the console.
2. In the **Explorer**, expand your project → hover over the dataset name.
3. Click the **three-dot menu** → **Share** (or **Permissions**).
4. In the panel:
   * Add the service account email.
   * Assign a dataset role:
     * **BigQuery Data Viewer** → read tables.
     * **BigQuery Data Editor** → read/write tables.
     * **BigQuery Data Owner** → full dataset control.
5. Click **Done**.


---

# Agent Instructions: 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:

```
GET https://guides.tability.io/docs/become-a-tability-power-user/integrations/google-service-account.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
