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

# ETL: Connecting to Google Sheets

> Connect Google Sheets to Integrate.io ETL for reading spreadsheet data. Set up Google OAuth authorization and configure the data connection.

Integrate.io ETL can access your Google Sheets data. This article details creating the Google Sheets connection and the process of building a data pipeline to read Google Sheets data in Integrate.io ETL. There are also pre-built templates to read data from a Google Sheet or write data to a Google Sheet. Please see [Create a package from a template](/etl/create-a-package-from-a-template/) for instructions on using a template.

## To create a Google Sheets connection in Integrate.io ETL

<Steps>
  <Step>
    Click the **Connections** icon (lightning bolt) on the top left menu.
  </Step>

  <Step>
    To create a connection, click **New connection**.

    <Frame>
      <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-187.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=11d99d57569085dd0926e4eedc8854ac" alt="New connection button in the Connections menu" width="1200" height="828" data-path="images/connectivity-and-security/image-187.webp" />
    </Frame>
  </Step>

  <Step>
    Select Google Sheets.

    <Frame>
      <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-188.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=8c90218930192681dfb895d29b4858f4" alt="Selecting Google Sheets from the connection type list" width="1200" height="828" data-path="images/connectivity-and-security/image-188.webp" />
    </Frame>
  </Step>

  <Step>
    Click **Authenticate.** (If required, sign in to Google Sheets)

    <Frame>
      <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-189.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=024d3ad40c5dbb3918f1a0bc2dc67f38" alt="Google Sheets connection window with Authenticate button" width="1200" height="828" data-path="images/connectivity-and-security/image-189.webp" />
    </Frame>
  </Step>

  <Step>
    Click **Connect** to authorize Integrate.io ETL access to your Google Sheets account.

    <Frame>
      <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-190.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=befc6ab7c79d928f6a3ad3bb8c3f5fde" alt="Google authorization prompt to grant access" width="1200" height="828" data-path="images/connectivity-and-security/image-190.webp" />
    </Frame>
  </Step>

  <Step>
    In the new Google Sheets connection window, name the connection and click **Create Google Sheets connection.**

    <Frame>
      <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-191.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=2140a3cf8392779f3544f994a40b8fb9" alt="Naming the Google Sheets connection and clicking Create connection" width="1200" height="828" data-path="images/connectivity-and-security/image-191.webp" />
    </Frame>
  </Step>
</Steps>

## To modify Google Sheets connections in Integrate.io ETL

<Steps>
  <Step>
    Click the **Connections** icon (lightning bolt) on the top left menu.
  </Step>

  <Step>
    Click a connection to re-connect if your password has changed or the token has expired.
  </Step>

  <Step>
    To delete a Google Sheets connection, click on the three vertical dots on the far right of the connection listing and select the Delete connection option.
  </Step>
</Steps>

## To build a data pipeline to read Google Sheets data in Integrate.io ETL

<Frame>
  <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-192.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=42cffaea0944bac5bd0d345a99a90e4f" alt="Google Sheets data pipeline overview in the package designer" width="748" height="758" data-path="images/connectivity-and-security/image-192.webp" />
</Frame>

## REST API Component: read\_spreadsheet

* **Authentication** - Click **Connection** and then select your Google Sheets connection. If you haven't created your Google Sheets connection yet, click **+ New** and follow the instructions found above.
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-193.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=f0ee79a6f3290e7850683d657af16a88" alt="REST API component authentication with Google Sheets connection selected" width="995" height="439" data-path="images/connectivity-and-security/image-193.webp" />
  </Frame>
* **URL** - Enter the URL for the Google Sheets API: **`https://sheets.googleapis.com/v4/spreadsheets/$spreadsheetId/values/$sheetName`**. Make sure the method is set to **GET.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-194.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=3087244cc3dc2c5041f7b87fc9df8832" alt="Google Sheets API endpoint URL configuration" width="986" height="323" data-path="images/connectivity-and-security/image-194.webp" />
  </Frame>
* **Sheet ID and name** - Replace the variables `$spreadsheetId` and \$sheetName with the values specific to your spreadsheet. You can find them located in the URL and at the bottom left.
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-195.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=9653bccba99527f0fffc6f5bfac0a472" alt="Spreadsheet URL showing sheet ID and sheet name location" width="1200" height="876" data-path="images/connectivity-and-security/image-195.webp" />
  </Frame>
* **Response** - Type `$.values[*]` in the Base record JSONPath Expression field. \* If the first record in your sheet contains field names, type `$.values[1:]` instead.
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-196.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=3a4775ac8fa3863e6d6cd1c0e41bdc30" alt="JSON response with base record JSONPath expression for values" width="984" height="301" data-path="images/connectivity-and-security/image-196.webp" />
  </Frame>
* **Input fields** - Click **Select all** to move values over to the Selected fields. Then click **Save.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-197.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=2527b77b39684ef1a658d985a2f12300" alt="Input fields with values moved to selected fields" width="1049" height="822" data-path="images/connectivity-and-security/image-197.webp" />
  </Frame>

## Select Component: bag\_to\_tuple

* Pass the values field into the BagToTuple function (for more information on the BagToTuple function see [this](/etl/bagtotuple/) article) - **BagToTuple(values)**. Click **Save.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-198.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=c02973982c34089a27d23dabcc11b836" alt="Select component using BagToTuple function on values" width="1051" height="821" data-path="images/connectivity-and-security/image-198.webp" />
  </Frame>

## Select Component: parse\_data

* Parse the individual fields in the **Expression** column using the tuple syntax - `values.$0`, `values.$1`, etc. Assign field names in the **Alias** column. When you parse the tuple, the items are returned as byte array datatypes. Explicitly cast them to the correct datatype. In the template, all fields have been cast to chararray (string). If you prefer a different datatype, change chararray to one of the datatypes that Integrate.io supports. See [this](/etl/using-expressions-in-integrateio-etl/) doc for supported datatypes and methods of casting and parsing. Click **Save.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-199.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=4d4092b273b6edc93ea401a61d3fa71f" alt="Select component parsing tuple fields with aliases" width="1052" height="720" data-path="images/connectivity-and-security/image-199.webp" />
  </Frame>
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-200.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=e92b00935a743cb0c31723118b4d2f0c" alt="Additional parsed fields with datatype casting" width="1048" height="826" data-path="images/connectivity-and-security/image-200.webp" />
  </Frame>

## Destination Component: sheet\_data

* The template shows a Redshift destination component; however, if you'd prefer to use a different destination, delete the Redshift component and select a destination component of your choice.
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-201.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=1f1f4d1f32842ef930ac6b490cdf6620" alt="Redshift destination component in the pipeline designer" width="1030" height="820" data-path="images/connectivity-and-security/image-201.webp" />
  </Frame>
* **Choose target connection** - Select your target connection. If you haven't created your connection yet, click **+ New.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-202.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=3844ea9e5c62b55850472a2c33f0f341" alt="Target connection selection dropdown" width="994" height="359" data-path="images/connectivity-and-security/image-202.webp" />
  </Frame>
* **Destination properties** - Fill in the values for target schema and table, select an operation type, pre or post-action SQL, and advanced options.
* **Schema mapping** - Click **Auto-fill** to bring in all of the fields. If you've selected a Merge operation type, click the **Key** box next to the merge key field(s). Click **Save.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-203.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=b203569d2d288a73698aac4a0a8a4136" alt="Schema mapping with auto-filled fields and merge key selection" width="1034" height="819" data-path="images/connectivity-and-security/image-203.webp" />
  </Frame>
