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.
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
Every 15 minutes ClickRuntime looks for CSV files in the Drive folder you choose.
Files it has not imported before are downloaded and read.
Their rows are added to the bottom of your Data tab with the source file name in an extra column.
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
Build your own
Need it to work differently?
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
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?
Can it import Excel files too?
Does it delete or move the CSV afterwards?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Create a Drive folder for each new hire in your roster
New rows in your Onboarding sheet get their own Drive folder from your template, shared with the new hire, with the link written back.
See how it worksTurn invoices dropped in a Drive folder into expense rows
Any invoice or receipt you drop into a Drive folder becomes a row in your expenses sheet with supplier, date, amount and VAT.
See how it worksScore CVs from a Drive folder into a spreadsheet
Every CV added to your Applicants folder becomes a row in your sheet with contact details, skills, experience and a score against the role.
See how it worksKeep exploring
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.