Skip to main content

Google Drive Setup Guide

Pre-requisites

  • A Google Drive account
  • The folder you want to sync, and its Google Drive URL.
  • The ability to share the folder with our service account email.

Setup Guide

Step 1: Share Google Drive folder with Matia

  1. Matia reads your folder through a service account it creates for you. Copy that service account's email address.
  2. In Google Drive, locate the folder Matia should read from.
  3. Open the folder's drop-down menu and choose Share.

Share Button

  1. Clicking Share opens the Share with people and groups pop-up. Paste the Matia service account email you copied in step 1 there.
  2. Choose Viewer permissions so Matia can read the files but not change them, then click Send.

Send Share Notification

  1. Copy the URL from google drive folder for authentication in Matia. (e.g https://drive.google.com/drive/folders/xxxxxxxx)

    Use the URL of the folder you just shared, since that is where Matia looks for files. A valid URL looks like the example below; the https:// prefix is optional.

    https://drive.google.com/drive/folders/1jIHAwecNaHunkIfYlbjaS\_WIRSUOIgG0

Step 2: Complete Configuration in Matia

  • Paste the folder URL into the required field under “Authentication”.
  • Enter Asset Name
  • (Optional) Enter Asset Description
  • (Optional) Assign Tags
  • Verify that your Google Drive account is successfully connected by clicking on Test Connection.
  • Click Connect

Final Setup Page Options:

Choose a Sync Mode

Sync ModeTypeDescription
Magic Folder ModeFull refresh only, does not support incremental or nested folder structure.Sync Each file in the chosen folder into a unique table.
Merge ModeSupports incremental syncs (only updates changed or new data).Sync All files (including those in subfolders) are combined into a single table in your destination.

Set a File Pattern (Optional)

This filters which files to sync from the folder.

Example:
*.json → syncs only .json files.
data_*.csv → syncs files like data_2023.csv, data_2024.csv.

Leave it blank if you want to sync all files in the folder.

Select JSON Delivery Mode

Choose how you wish to structure your data in the destination:

  • Packed: All data goes into one column as a JSON blob.
  • Unpacked: JSON is flattened into individual columns (recommended if you want to query fields easily).

Error Handling Mode

When encountering an error, choose either:

  • Fail: The sync job stops if any file throws an error.
  • Skip: The sync skips over bad files and continues processing the rest.

Merge Mode – Additional Configuration: Primary Key for Upsert

When you select Merge Mode, you’ll see an option called "Primary Key for Upsert." This determines how the system updates or inserts new rows into the destination table during sync.

1. File Name and Line Number

  • Use this when your files are uniquely named and only contain new, fresh data and you just want to insert new data each time or overwrite old lines in the same file.
  • The system uses: _file : the filename, _line : the line number in the file
  • This pair ensures each line in each file is treated as unique.

2. File Name, Line Number, and Modified

  • Use this when files may contain both old and updated data, such as partial refreshes or late-arriving data. You want to maintain a more complete or versioned history.
  • The system uses: _file, _line, and _modified (last modified timestamp)
  • This combo allows the sync to track changes over time more intelligently.