# Google Sheets Import Integration The integration for Google Sheets enables you to import the data from Google sheets. This topic includes: ## Prerequisites - Basic knowledge of Treasure Data - A Google account (for Google Drive). - Authorized Treasure Data account access. ## Static IP Address of Treasure Data Integration If your security policy requires IP whitelisting, you must add Treasure Data's IP addresses to your allowlist to ensure a successful connection. Please find the complete list of static IP addresses, organized by region, at the following link: [https://api-docs.treasuredata.com/en/overview/ip-addresses-integrations-result-workers/](https://api-docs.treasuredata.com/en/overview/ip-addresses-integrations-result-workers/) ## Import from Google Sheets via TD Console ### Create a New Connection When you configure a data connection, you provide authentication to access the integration. In Treasure Data, you configure the authentication and then specify the source information. 1. Open **TD Console**. 2. Navigate to **Integrations Hub** > **Catalog.** 3. Search for and select Google Sheets. ![](/assets/image-20200714-191234.8e3b45a96e184ca108805c3c05eecd9f52dcbac1d62a5f10a58c9fc48051d60a.af95bf87.png) 4. The following dialog opens. ![](/assets/google-sheets-import-integration-2024-07-09-1.28eb39c623cfed0615d6c90479ec719963e7726b6ebe15288f1baa946872d031.af95bf87.png) 5. Authenticate the connection by selecting an existing OAuth connection or creating a new one. ![](/assets/google-sheets-import-integration-2024-02-16-1.3738eafb930d43a6d9e6941f2ad069bd46ec763d2b8507adb0e8d86750046afa.af95bf87.png) 6. Name your new Google Sheets connection. ![](/assets/image-20200714-191357.6cafe77464510a9057f559ba8de722fa5fbbe900692adf4b99ce01512f547f43.af95bf87.png) ### Account Authentication Access to Treasure Data Google Sheets integration requires OAuth2 authentication. The authentication requires that users manually connect their Treasure Data account to their respective Google account. If you don’t have an existing connection, create a new authentication. 1. After opening the authentication dialog, select the link under "OAuth connection" to create a new connection 2. Log into your Google Sheets account in the popup window and grant access to the Treasure Data app. ![](/assets/google-sheets-import-integration-2024-02-16-3.571cee3a817048d15bbdde0694ffb98509978e989f997e61df0370d629604c09.af95bf87.png) 3. You are redirected back to integration dialog pane. Select Google Sheets and select the new connection from the drop-down menu. ![](/assets/image-20200714-191541.266ebc67b2cc0fe903ea58bca3f21708ca464d6e3f8d435f2f14a61effccfec9.af95bf87.png) ### Create a Source After creating the authenticated connection, you are automatically taken to Authentications. 1. Search for the connection you created. ![](/assets/image-20200714-191606.086bde3067c5d2a453b21aac44d2ca59ad78bacf6bbd28001510906f734ecf39.af95bf87.png) 2. Select **New Source**. 3. Type a name for your **Source**in the Data Transfer field**.** 4. Click **Next**. ![](/assets/image-20200714-191642.2259861ad196cbbb4458b05840a1262dbad90d9aa8e369eb61b0057d88bdb866.af95bf87.png) ### Identify a Source Table 1. Edit the following parameters ![image-20200930-050110.png](/assets/image-20200714-191722.18fd9514e7c4952cc5d459060168cab95207ab20d6a7113182964ada92f9f9f7.af95bf87.png) | **Parameters** | **Description** | | --- | --- | | Spreadsheet Key | Specify the Google Spreadsheet key | | Worksheet Title | Title of worksheet after importing to TD | | Range to fetch | Range of fetch data from Google Spreadsheet Use A1 notation without worksheet title (eg. A1:C100). When you specify the range to fetch, make sure there is data within the range. If empty, ingest the whole sheet and number of columns is defined by the first row/column. | | Use first row/column as header | Select if you want to keep the first row or column as a header. | | Skip first rows/columns | Skip n top rows when using Rows dimension or n left columns when using Column dimension | | Major Dimension | Choose Rows or Columns | | Value Render Option | Formatted value or Unformatted value | | Date Time Render Option | Formatted String or Serial Number Ignored if using Formatted Value in Value Render | ### Define Data Settings 1. Click **Next**. The Data Settings page opens. 2. Optionally, edit the data settings or skip this page of the dialog. ### Data Preview You can see a [preview](/products/customer-data-platform/integration-hub/batch/import/previewing-your-source-data) of your data before running the import by selecting Generate Preview. Data preview is optional and you can safely skip to the next page of the dialog if you choose to. 1. Select **Next**. The Data Preview page opens. 2. If you want to preview your data, select **Generate Preview**. 3. Verify the data. ### Data Placement For data placement, select the target database and table where you want your data placed and indicate how often the import should run. 1. Select **Next.** Under Storage, you will create a new or select an existing database and create a new or select an existing table for where you want to place the imported data. 2. Select a **Database** > **Select an existing** or **Create New Database**. 3. Optionally, type a database name. 4. Select a **Table**> **Select an existing** or **Create New Table**. 5. Optionally, type a table name. 6. Choose the method for importing the data. - **Append** (default)-Data import results are appended to the table. If the table does not exist, it will be created. - **Always Replace**-Replaces the entire content of an existing table with the result output of the query. If the table does not exist, a new table is created. - **Replace on New Data**-Only replace the entire content of an existing table with the result output when there is new data. 7. Select the **Timestamp-based Partition Key** column. If you want to set a different partition key seed than the default key, you can specify the long or timestamp column as the partitioning time. As a default time column, it uses upload_time with the add_time filter. 8. Select the **Timezone** for your data storage. 9. Under **Schedule**, you can choose when and how often you want to run this query. #### Run once 1. Select **Off**. 2. Select **Scheduling Timezone**. 3. Select **Create & Run Now**. #### Repeat Regularly 1. Select **On**. 2. Select the **Schedule**. The UI provides these four options: *@hourly*, *@daily* and *@monthly* or custom *cron*. 3. You can also select **Delay Transfer** and add a delay of execution time. 4. Select **Scheduling Timezone**. 5. Select **Create & Run Now**. After your transfer has run, you can see the results of your transfer in **Data Workbench** > **Databases.**