Skip to main content
Integrate.io ETL reads CSV, TXT, and JSON files from Google Drive with a File Storage source, and can move processed files to another Drive folder after a successful run. You can connect with your own Google account (OAuth) or with a Google Cloud service account.

Connection Setup

OAuth Connection

1
Click the Connections icon (lightning bolt) on the top left menu.
2
To create a connection, click New connection.
New connection button in the Connections menu
3
Select Google Drive.
Selecting Google Drive from the connection type list
4
Click Authenticate. (If required, sign in to Google Drive)
5
Click Connect to authorize Integrate.io ETL access to your Google Drive account.The consent screen asks you to allow Integrate.io to see, edit, create, and delete all your Google Drive files. A single connection needs read and write access so it can both read source files and move processed files to another folder after a successful run.
6
In the new Google Drive connection window, name the connection and click Create Google Drive connection.
Connections created before this scope change keep their original read-only authorization. To use Move processed files to another folder on a Google Drive source, reconnect the existing connection or create a new one so the updated permissions are granted.

Service Account Connection

Use a service account when you don’t want the connection tied to one person’s Google account, or when the files live in a Shared Drive that belongs to your organization. A service account can only see files and folders that are explicitly shared with its email address, and it has no usable My Drive of its own.
1
In the Google Cloud Console, select your project and go to IAM & Admin > Service Accounts > Create Service Account. Name the service account (for example, integrateio-google-drive) and click Done. No project-level roles are needed; access is granted per folder.
2
Open the new service account, go to the Keys tab, and click Add Key > Create new key. Choose JSON and click Create. Keep the downloaded .json file secure.
3
Copy the service account’s email address. It ends in @<project-id>.iam.gserviceaccount.com.
4
Go to APIs & Services > Library, search for Google Drive API, and click Enable. Enable it in the same project that owns the service account.
5
In Google Drive, share the folder you want to read with the service account’s email address. Viewer access is enough to read files. To use Move processed files to another folder, the folder must be in a Shared Drive, and the service account needs a role there that can move files, such as Content manager.
6
Copy the folder ID from the folder’s URL, the part after /folders/ in https://drive.google.com/drive/folders/<FOLDER_ID>. You enter it in the source component’s Drive Folder ID field.
7
In Integrate.io ETL, click the Connections icon (lightning bolt), click New connection, and select Google Drive (Service Account). Name the connection, upload the JSON key file, and create the connection.

Modifying Google Drive Connections

1
Click the Connections icon (lightning bolt) on the top left menu.
2
Click a connection to re-connect if your password has changed or the token has expired.
3
To delete a Google Drive connection, click the three vertical dots on the far right of the connection listing and select the Delete connection option.
For a service account connection, upload a new JSON key to replace the stored one, for example after rotating the key in Google Cloud. Deleting the connection in Integrate.io doesn’t delete the service account or its key in Google Cloud.

Google Drive Source Configuration

Add a File Storage source component and select your Google Drive or Google Drive (Service Account) connection. Before each job runs, Integrate.io downloads the matching files from Drive to the cluster and reads them from there. See File Storage Options for the format, schema, and header settings shared with other file storage sources.

Source Location

Google Drive has no bucket, so no bucket field is shown. The Drive Folder ID, Source path, and Move processed files destination path can’t contain $, a backtick, a double quote ("), or a single quote (').

Supported Formats

Google Drive sources read text formats only: Delimited values, JSON, and Raw. Excel and Parquet files and ZIP archives are not supported. The file_modified_at meta data field isn’t available, because files are copied to the cluster before they are read.

Source Action

Two source actions are available for Google Drive:
  • Process all files directly from source (default).
  • Move processed files to another folder. After the job processes the files, Integrate.io moves them to the folder in Destination path, for example processed/. The path is resolved inside the source component’s Drive Folder ID, not as a bucket path.
Process only new files (Incremental load) and Copy, merge and process all files aren’t available for Google Drive, and Append string to filename isn’t offered. Moving files needs Drive write access:
  • OAuth connections authorized before Integrate.io requested full Drive access are read-only. Reconnect the connection to grant write permission, or the move fails at job time with a 403 error.
  • For service account connections, the destination folder must be in a Shared Drive that is shared with the service account.

Troubleshooting

  • 403: The caller does not have permission: the folder isn’t shared with the service account, the access level is too low, or an OAuth connection is still read-only. Share the folder again with the right role, or reconnect the OAuth connection.
  • API has not been used in project ... before or it is disabled: enable the Google Drive API in the project that owns the service account.
  • A service account finds no files: check that Drive Folder ID is set to a folder shared with the service account. A service account’s own drive is empty.

Alternative: Reading Drive Files Through the REST API

To read files the File Storage source doesn’t support, such as Google Workspace documents exported on the fly, call the Drive REST API from a pipeline. The steps below show the pattern.
Google Drive file reading pipeline overview in the package designer

REST API Component: get_file_ids

  • The first call to the Google Drive API will be to search for the files you want to extract and get their ids.
  • Authentication - Click Connection and then select your Google Drive connection. If you haven’t created your Google Drive connection yet, click + New and follow the instructions found above.
    REST API component authentication with Google Drive connection selected
  • URL - Enter the URL for the Google Drive API: https://www.googleapis.com/drive/v3/files?q=$query\_string. Make sure the method is set to GET. Replace the variable $query_string with your own URL encoded query string. The query string is how you pass your search parameters to the API in order to find the files you want to download. For other examples of query strings, see this doc.
    Google Drive API files endpoint URL configuration
  • Response - Type $.files[*] in the Base record JSONPath Expression field.
    JSON response with base record JSONPath expression for files
  • Input fields - Click + icon to the right of the ‘id’ field to move it over to the Selected fields. Then click Save.
    Input fields with id field moved to selected fields

Select Component: get_files

  • The second call to the Google Drive API will be to pass those ids to the API and get the files that match them.
    Select component for retrieving files by their IDs
  • Type this expression in the Expression Editor: CCurl(CONCAT(‘https://www.googleapis.com/drive/v3/files/’, id, ‘?alt=media’), ‘GET’, ”, ”, ‘$google_drive_connection_id’)#‘body’. Replace the variable $google_drive_connection_id with your own unique Google Drive connection id string. This can be found in the Connections menu. Find your GoogleDrive connection and there will be a unique connection id string beneath the connection name. Click it to copy it. (It will look something like this: GOOGLEDRIVE_CONNECTION_10818)
    CCurl expression using Google Drive connection ID

Select Component: flatten_split_records

  • Pass the api_response_body field into the function STRSPLITTOBAG along with the newline character as the delimiter regex and the result of that into Flatten (see these docs for more information on the STRSPLITTOBAG or Flatten functions) - Flatten(STRSPLITTOBAG(api_response_body, ‘\n’)). Click Save.
    Select component using Flatten and STRSPLITTOBAG to split records

Filter Component: remove_header

  • Select the NOT condition from the dropdown menu. Then select the line field from the dropdown menu on the Expression side, then select the Text matches (regex) in the Operator dropdown menu, and lastly type .*add_time.* in the Value/Expression field. This will remove the record which contains the column headers from the data set.
    Filter component with NOT condition to remove header row

Select Component: split_line

  • Pass the line field into the CSVSPLIT function with the comma selected as the delimiter regex (for more information on the CSVSPLIT function see this article) - CSVSPLIT(line, ’,’). Click Save.
    Select component using CSVSPLIT to split lines by comma

Select Component: extract_fields

  • After the previous component executes the line field is a tuple. You can parse the tuple into its individual items using the syntax field_name.$0, field\_name.$1, field_name.$2, etc. You can see this in the examples of this doc. 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 doc for supported datatypes and methods of casting and parsing. Last, add fields up to the number of columns in your schema by clicking the + icon to the right of any of the fields and rename the aliases according to your column names. For instance, if field_0 is the ‘id’ column, type ‘id’ in the alias for that field.
    Select component extracting individual fields from tuple

Destination Component: drive_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.
    Redshift destination component in the pipeline designer
  • Choose target connection - Select your target connection. If you haven’t created your connection yet, click + New.
    Target connection selection dropdown
  • 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.
    Schema mapping with auto-filled fields and merge key selection
Last modified on October 27, 2026