Skip to content

Every 15 minutes

Import new Drive CSV files into Google Sheets

CSV files dropped into a Drive folder are appended to one Google Sheets tab, with the file name on every row.

Runs
Every 15 minutes
Apps
Google Drive, Google Sheets
AI
Not needed
Access
Google Drive read; Google Sheets read+write

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, check my Exports folder in Drive for new CSV files and append their rows to the Data tab of my sheet, skipping the header row and adding the file name in the last column.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Many tools still only export CSV: bank statements, payment processors, ad platforms, warehouse systems. People save these files to a Drive folder and then copy and paste them into a master sheet, often forgetting one or pasting one twice.

This automation watches the folder and appends each new CSV's rows to one tab, stamping every row with the file it came from, so the master sheet keeps growing on its own.

Bookkeepers, operations staff and analysts use it to collect recurring exports into a single place for formulas and pivot tables.

What you get out of it

  • No more copy and paste

    Drop the file in Drive and its rows appear in the sheet within 15 minutes.

  • Each file once

    Imported files are remembered, so the same export is never added twice.

  • Traceable rows

    The file name column shows where every row came from when numbers need checking.

  • Header rows skipped

    Only data lines are added, keeping one clean header at the top.

  • Works with any exporter

    Anything that can save a CSV to Drive, by hand or by sync, can feed the sheet.

How it works

What happens, step by step

  1. Every 15 minutes ClickRuntime looks for CSV files in the Drive folder you choose.

  2. Files it has not imported before are downloaded and read.

  3. Their rows are added to the bottom of your Data tab with the source file name in an extra column.

  4. Imported files are remembered, so each file is added once.

Before it runs live

  • Connect Google Drive
  • Connect your Google Sheets account and pick the spreadsheets it may use

What you get

RunsEvery 15 minutes
Import new Drive CSV files into Google Sheetstoday, 9:00Succeeded
Google Sheets · Bank feed › Data2026-11-09 | CARD 4411 OFFICE SUPPLY CO | -86.20 | EUR | statement-2026-11-09.csv

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Google Drive and Google Sheets steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
import_new_drive_csv_files_into_google_sheets.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
import csv, io
from googleapiclient.http import MediaIoBaseDownload
from clickruntime import on_trigger, credentials, state, report_fetched

FOLDER_ID = "your-folder-id"
SHEET_ID = "your-spreadsheet-id"

@on_trigger
def run(event):
    creds = Credentials(credentials.connection("google", "work"))
    drive = build("drive", "v3", credentials=creds, cache_discovery=False).files()
    done = set(state.get("imported") or [])
    files = drive.list(q=f"'{FOLDER_ID}' in parents and mimeType = 'text/csv' and trashed = false",
                       orderBy="createdTime", fields="files(id,name)", pageSize=100).execute()["files"]
    new = [f for f in files if f["id"] not in done]
    report_fetched(len(new))
    if not new:
        return {"imported": 0}
    tab = build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets().values()
    added = 0
    for f in new:
        buf = io.BytesIO()
        loader = MediaIoBaseDownload(buf, drive.get_media(fileId=f["id"]))
        while not loader.next_chunk()[1]:
            pass
        rows = list(csv.reader(io.StringIO(buf.getvalue().decode("utf-8-sig"))))[1:]
        rows = [r + [f["name"]] for r in rows if any(c.strip() for c in r)]
        if rows:
            tab.append(spreadsheetId=SHEET_ID, range="Data!A:A", valueInputOption="USER_ENTERED",
                       body={"values": rows}).execute()
        added += len(rows)
        done.add(f["id"])
        state.set("imported", list(done)[-2000:])
    return {"files": len(new), "rows": added}

FAQ

Common questions

What if the CSV columns change?
Rows are appended in the order they appear in the file. If a supplier adds a column, the data shifts; ask your assistant to map columns by header name instead so the order no longer matters.
Can it import Excel files too?
Yes. Ask your assistant to also pick up .xlsx files and read them with a spreadsheet library before appending.
Does it delete or move the CSV afterwards?
Not by default. It only remembers which files were imported. You can ask for imported files to be moved into a Processed subfolder.
What permissions does it need?
Google Drive read; Google Sheets read+write. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Import new Drive CSV files into Google Sheets” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.