Every 15 minutes
Turn 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.
- Runs
- Every 15 minutes
- Apps
- Google Drive, Google Sheets
- AI
- Yes, uses the built-in AI allowance
- Access
- Drive read+write; Sheets read+write
Send this to your assistant
Create a ClickRuntime automation: every 15 minutes, check my Drive 'Invoices' folder for new PDFs or images, pull out the supplier, date, amount and VAT, and add them to my expenses sheet.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A sole trader photographs receipts on the go and saves supplier PDFs into a Drive folder. At the end of each quarter she spends an evening opening every file and typing figures into a spreadsheet for her VAT return, and still finds a few she missed.
This automation reads each new file as it lands in the folder and adds a row to your expenses sheet. By the end of the quarter the sheet is already complete.
What you get out of it
VAT returns without the quarter-end scramble
Expenses are logged as they come in, so the figures are ready when the return is due.
Save the file, that is all
Dropping a photo or PDF into a folder from your phone is the only step. No forms, no typing on a small screen.
A link back to every receipt
Each row links to its file, so your accountant can check any figure against the original.
Each file handled once
Processed files are marked in Drive, so they are never logged twice even if the folder is reorganised.
How it works
What happens, step by step
Every 15 minutes ClickRuntime checks your Drive 'Invoices' folder for files added since the last check.
AI reads each invoice or receipt and picks out the supplier, date, total and VAT.
Each file is marked as processed in Drive so it is never logged twice.
A row with the details and a link to the file is added to your expenses sheet.
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
- Change what the AI looks for, or how it writes the result
- 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
import base64
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, ai, state, report_fetched
FOLDER_ID, SHEET_ID = "your-invoices-folder-id", "your-spreadsheet-id"
SCHEMA = {"type": "object", "properties": {k: {"type": "string"} for k in ("supplier", "date", "total", "vat")}}
@on_trigger
def run(event):
creds = Credentials(credentials.connection("google", "work"))
drive = build("drive", "v3", credentials=creds, cache_discovery=False)
since = state.get("since") or "2026-01-01T00:00:00"
q = f"'{FOLDER_ID}' in parents and createdTime > '{since}' and not properties has {{key='logged' and value='yes'}}"
files = drive.files().list(q=q, orderBy="createdTime", fields="files(id,name,createdTime,webViewLink)").execute().get("files", [])
report_fetched(len(files))
if not files:
return {"logged": 0}
rows = []
for f in files:
text = drive.files().export(fileId=drive.files().copy(fileId=f["id"], body={"mimeType": "application/vnd.google-apps.document"}).execute()["id"],
mimeType="text/plain").execute().decode()[:6000]
x = ai.generate(f"Extract supplier, date (YYYY-MM-DD), total and VAT from this invoice:\n{text}", json_schema=SCHEMA, max_output_tokens=120).json
rows.append([x.get("supplier"), x.get("date"), x.get("total"), x.get("vat"), f["webViewLink"]])
drive.files().update(fileId=f["id"], body={"properties": {"logged": "yes"}}).execute()
build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets().values().append(
spreadsheetId=SHEET_ID, range="Expenses!A:E", valueInputOption="USER_ENTERED", body={"values": rows}).execute()
state.set("since", files[-1]["createdTime"][:19])
return {"logged": len(rows)}FAQ
Common questions
Which file types work?
What if a field cannot be read?
Can I use subfolders by month?
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
Score 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 worksWrite social captions for images you drop in Drive
Each image you add to your Drive Posts folder gets a caption and hashtags in your Content sheet, ready to post.
See how it worksGenerate images from prompts in a sheet and save them to Drive
Each new prompt you add to your Images sheet becomes an image in your Drive, with the link added to the row.
See how it worksKeep exploring
Set up “Turn invoices dropped in a Drive folder into expense rows” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.