# Google Sheets

**Integration type**: `Write`

Integration with Google Sheets allows you to stream data from any data source to spreadsheets in real-time.

**Data for the connection:**

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2F06zzDi3b1av17Vo8ZIQN%2FScreenshot%202024-04-23%20at%2018.53.19.png?alt=media&#x26;token=2e489f39-8b69-4e78-9d4c-4c5c706b23d1" alt=""><figcaption></figcaption></figure>

## Setting up integration

### Step 1. Creating a service account with JSON credentials

1. In the Google Cloud console, [go to the Service accounts](https://console.cloud.google.com/iam-admin/serviceaccounts?walkthrough_id=iam--create-service-account-keys\&start_index=1#step_index=1).
2. Select a project.
3. Create a new service account or select an existing one.

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FFQzj6UiIXe9maTfvoDHA%2FScreenshot%202024-07-26%20at%2018.57.06.png?alt=media&#x26;token=6e1446ab-8d42-4cdd-a7d1-60e227e08143" alt=""><figcaption></figcaption></figure>

Steps 2 and 3 are optional and are not needed if you want to make basic Ylem's integration work. As soon as the service account is created, create a key with JSON credentials for it:

1. Click the email address of the service account that you want to create a key for.
2. Click the **Keys** tab.
3. Click the **Add key** drop-down menu, then select **Create new key**.
4. Select **JSON** as the Key type and click **Create**.

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FdDXr1jDz8nnbcev4k09x%2FScreenshot%202024-07-26%20at%2018.58.34.png?alt=media&#x26;token=758ad9f2-cb1f-4be0-85de-d6abc89b37d7" alt=""><figcaption></figcaption></figure>

Clicking **Create** downloads a service account key file. After you download the key file, you cannot download it again.

### Step 2. Enable Google Sheets API

Go to <https://console.developers.google.com/apis/api/sheets.googleapis.com/overview>, select the project, and confirm enabling Google Sheets API.

### Step 3. Create Google Sheet and grant access to it to the service account

Go to the Google Sheet you want to stream data to, click on File -> Share -> Share with others, and share it with the service account you just created.

<div><figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2F405BKsjODaOfBIbEWmB6%2FScreenshot%202024-07-26%20at%2021.00.38.png?alt=media&#x26;token=ede076af-4843-4d25-a0ef-34ae4988b9d0" alt=""><figcaption></figcaption></figure> <figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FzRS3BCL4JeFiJtW9tG0O%2FScreenshot%202024-07-26%20at%2021.00.02.png?alt=media&#x26;token=908dedb9-4788-4db2-9f69-b06ce32422e5" alt=""><figcaption></figcaption></figure></div>

### Step 4. Create an integration

Now you can create an integration in Ylem by adding JSON credentials, Spreadsheet ID, and Sheet ID. The last two parameters you can get from the URL of the spreadsheet you just created:

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2F931Vkkh8iZdJrfYBNELZ%2FScreenshot%202024-07-26%20at%2021.07.51.png?alt=media&#x26;token=10a95392-efa1-4ad2-a465-6fcbb87fee6d" alt=""><figcaption><p>Spreadsheet Id</p></figcaption></figure>

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FcubcGSr4xbuwFmx0mpvZ%2FScreenshot%202024-07-26%20at%2021.08.02.png?alt=media&#x26;token=8a77bdbd-7d5b-44d1-8396-3d1a16620a02" alt=""><figcaption><p>Sheet Id</p></figcaption></figure>

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FsnyrBtPx7SBVLiMdydPJ%2FScreenshot%202024-07-26%20at%2021.08.30.png?alt=media&#x26;token=37b4fe8a-69d0-41c1-b53f-6eacdeda8291" alt=""><figcaption></figcaption></figure>

### Step 5. Create a test pipeline and stream data

Now you can create a pipeline and run it to stream data to the new spreadsheet:

<div><figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FoBCwVooWOoDoovhmjj2q%2FScreenshot%202024-07-26%20at%2021.11.46.png?alt=media&#x26;token=b5759006-3d22-4e8f-bb1c-468c180b29ec" alt=""><figcaption></figcaption></figure> <figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2F39Xcm9Ag9ijmDVwC7HB2%2FScreenshot%202024-07-26%20at%2021.12.24.png?alt=media&#x26;token=755bbfd6-b52a-4810-b0bc-98f7132f8416" alt=""><figcaption></figcaption></figure> <figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2F6R48v2BoTJhoeT2iBNHl%2FScreenshot%202024-07-26%20at%2021.12.07.png?alt=media&#x26;token=47b3fd49-7b29-47c6-9e44-c22f230d0d0a" alt=""><figcaption></figcaption></figure></div>

If you run the pipeline now, the new content should appear in the spreadsheet:

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FN3m4i4mP4jp8lvNXvTwb%2FScreenshot%202024-07-26%20at%2021.14.16.png?alt=media&#x26;token=920415c0-6edd-4cb0-9bf8-635b074735cf" alt=""><figcaption></figcaption></figure>
