Every 15 minutes
Import new CSV files into an Excel table
When a CSV lands in your OneDrive folder, its rows are added to your Excel table automatically.
- Runs
- Every 15 minutes
- Apps
- Microsoft Excel, OneDrive
- AI
- Not needed
- Access
- Files.ReadWrite
Send this to your assistant
Create a ClickRuntime automation: every 15 minutes, check my OneDrive Imports folder for new CSV files and add their rows to the Data table in my Excel workbook.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Many tools only offer a CSV export: the bank, the shop, the booking system. Someone downloads it, opens Excel, copies the rows across and fixes the formatting, every week, and occasionally pastes the same file twice.
Dropping the CSV into a OneDrive folder and letting the rows flow into your Excel table removes the copy and paste, keeps the format consistent, and makes sure each file is imported once.
What you get out of it
No copy and paste
Save the CSV into the folder and you're done. The rows appear in your table within 15 minutes.
Each file imported once
Files already imported are remembered. Dropping the same export twice won't double your numbers.
Formulas keep working
Rows go into an Excel table, so formulas, charts and pivot tables extend to include them.
Works from anywhere
Save the file from your phone, another computer or a colleague's account. If it lands in the folder, it's imported.
How it works
What happens, step by step
Every 15 minutes it checks your OneDrive folder for new or changed CSV files.
Each new CSV is downloaded and its header row is skipped.
The rows are added to the table in your Excel workbook.
It keeps track of what it has already seen in the folder, so each file is imported only once.
Before it runs live
- Connect Microsoft Excel
- Connect OneDrive
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 Microsoft Excel and OneDrive steps into one automation
Under the hood
The code that runs this automation
GRAPH = "https://graph.microsoft.com/v1.0"
import csv, io
from clickruntime import on_trigger, credentials, http, state, report_fetched
FOLDER = "/me/drive/root:/Imports"
TABLE = "/me/drive/root:/Data/data.xlsx:/workbook/tables/Data/rows/add"
COLS = 5
@on_trigger
def run(event):
h = {"Authorization": f"Bearer {credentials.connection('microsoft', 'work')}"}
url = state.get("delta") or f"{GRAPH}{FOLDER}:/delta"
files, page = [], {}
while url:
page = http.get(url, headers=h).json()
files += [f for f in page["value"] if f.get("file") and f["name"].lower().endswith(".csv") and not f.get("deleted")]
url = page.get("@odata.nextLink")
report_fetched(len(files))
if not files:
state.set("delta", page.get("@odata.deltaLink"))
return {"summary": "Nothing new"}
added = 0
for f in files:
text = http.get(f"{GRAPH}/me/drive/items/{f['id']}/content", headers=h).content.decode("utf-8-sig")
rows = [(r + [""] * COLS)[:COLS] for r in list(csv.reader(io.StringIO(text)))[1:] if any(r)]
if rows:
http.post(f"{GRAPH}{TABLE}", headers=h, json={"values": rows}).raise_for_status()
added += len(rows)
state.set("delta", page.get("@odata.deltaLink"))
return {"files": len(files), "rows": added}FAQ
Common questions
Do the CSV columns need to match the table?
Does it skip the header row?
Can it update existing rows instead of adding them?
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
Save email attachments to OneDrive and log them in Excel
Attachments from your inbox are saved to OneDrive and each one is listed in an Excel log you can filter and search.
See how it worksCombine Excel files from OneDrive into one workbook
Every 15 minutes, rows from new Excel files dropped in a OneDrive folder are added to a table in one master Excel workbook, with the source file name on each row.
See how it worksAdd form responses to an Excel workbook
Every form submission is added as a row in your Excel workbook on OneDrive, with an email so you see it straight away.
See how it worksKeep exploring
Set up “Import new CSV files into an Excel table” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.