# Connect BigQuery

Connect BigQuery to Justwon, see what Justwon reads and may do, and disconnect it.

## Before you start

- **In Justwon:** you must be an owner or an admin of the workspace. A BigQuery connection belongs to the whole workspace. See [Roles](https://justwon.ai/docs/get-started/roles).
- **Your credential:** In Google Cloud, create a service account for Justwon with read access to the dataset, and download its JSON key.

## Connect

1. Sign in to https://app.justwon.ai and open **Integrations**.
2. Open the **Available** tab, find **BigQuery** and select it. Its card says **Connect**.
3. Fill in the form, then select **Connect**. It asks for these values:
   - **GCP Project ID**.
   - **Service Account JSON Key**. Paste the full JSON key file downloaded from Google Cloud IAM.
   - **Dataset location** (optional). Where your BigQuery datasets are stored. Queries run in this location, so it must match the datasets.

Justwon does not read BigQuery on a schedule. It queries it when a question needs the figures.

## What Justwon reads

Justwon reads product usage figures from your BigQuery datasets, by running queries when a question needs them.

## What Justwon may do

Nothing. Justwon only reads from BigQuery; it never changes anything there.

## Disconnect

1. Open **Integrations** and the **Connected** tab, and select the BigQuery connection.
2. Open the **Configuration** tab. Under **Disconnecting**, select the button for BigQuery, then select **Disconnect**.

Reading stops and the connection is removed. What stays and what goes is the same for every tool: see [Where your data is held](https://justwon.ai/docs/security/where-your-data-is-held). Remove the key or token you created in BigQuery too, so nothing is left that could be used.

## If the connection does not finish

- **BigQuery says the credential is wrong.** Create it again and paste it without spaces before or after. Check that it belongs to an account that can see the data Justwon reads.
- **The connection stops later and asks you to reconnect.** The credential was removed or has expired. Select the connection and reconnect it with a new one. The configuration and everything already read are kept. See [a connection that is stuck](https://justwon.ai/docs/troubleshooting/connection-stuck).
