# 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="/files/pMzo2STmdbjvQ4shjaKq" 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="/files/eHCEuauoJ22WKRStAfwC" 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="/files/VtgKua3iR7rsf1J89K8h" 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="/files/hyGkz5yIItCXYPjUg9LR" alt=""><figcaption></figcaption></figure> <figure><img src="/files/q2gfisSBHOHsAqBXrN0R" 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="/files/zYboXuV3esBysKgECzIE" alt=""><figcaption><p>Spreadsheet Id</p></figcaption></figure>

<figure><img src="/files/mRi5yjJhnrWDPUyvZTVm" alt=""><figcaption><p>Sheet Id</p></figcaption></figure>

<figure><img src="/files/JHlEZO9EBrcJcv1G5wla" 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="/files/vpbIdoZRmUmqCqJdmnPo" alt=""><figcaption></figcaption></figure> <figure><img src="/files/TA3M7k1B58yM6RQOLveG" alt=""><figcaption></figcaption></figure> <figure><img src="/files/5F1xoLcCwoQ4bl01mhey" alt=""><figcaption></figcaption></figure></div>

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

<figure><img src="/files/9yI4EGBtXhEjjfSjAUoX" alt=""><figcaption></figcaption></figure>


---

# 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://docs.ylem.co/integrations/library-of-integrations/google-sheets.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.
