Extract expense details from receipts in Google Drive, analyze with ChatGPT, and add to Google Sheets
Each new receipt in your Drive folder is read by ChatGPT and logged as one row in your expense sheet, with its merchant, date, total and a link to the file.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/log-expense-receipts-from-google-drive-to-google-sheets/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- Finance · Financial reporting
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/log-expense-receipts-from-google-drive-to-google-sheets
Set it up with the CLI
- Add it. Copies the folder into
zaps/log-expense-receipts-from-google-drive-to-google-sheets/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/log-expense-receipts-from-google-drive-to-google-sheets - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy log-expense-receipts-from-google-drive-to-google-sheets - Check it. Its recent runs, with status and errors.
npx zap-pack logs log-expense-receipts-from-google-drive-to-google-sheets
zaps/log-expense-receipts-from-google-drive-to-google-sheets/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 1 to fill in
- connections/chatgpt.tsThe
chatgptaccount it uses - connections/google-drive.tsThe
google-driveaccount it uses - connections/google-sheets.tsThe
google-sheetsaccount it uses - triggers/file-in-folder-v2.tsWhat starts it:
google-drivefile_in_folder_v21 to fill in - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: a new file is added to the receipt folder in Google Drive (
google-drive,file_in_folder_v2). - ChatGPT reads the receipt image and describes its merchant, date, line items, tax, total and currency.
- ChatGPT turns that description into the fields of one expense: merchant, receipt date, total, currency and category. Missing values stay empty.
- Google Sheets adds one row to the expense log with the time it was logged, the Drive file ID and name, a link to the receipt, and the extracted fields.
The Zap only reads files and writes to the sheet; it never moves or changes a receipt.
Ask the user
Each REPLACE_… value is set per person. Resolve names to IDs with the user's own connections; don't ask them to paste an ID you can look up.
| Setting | Where | What goes there |
|---|---|---|
folder (trigger) |
triggers/file-in-folder-v2.ts |
The Drive folder receipts are uploaded to: ask which folder it is, then look up its ID with the user's Google Drive connection |
SPREADSHEET_ID |
config.ts |
The expense log: ask which sheet it is, then look up its ID (the long ID in its URL) with the user's Google Sheets connection |
Also review the defaults with them:
WORKSHEET_ID: the tab holding the log."0"is the first tab.MODEL_ID: the ChatGPT model that reads the receipts.gpt-4ohandles images.- The
…_COLUMNvalues: column keys such asCOL$A, not header names. Map the user's headers to their column letters, or point a column at an empty column they don't use.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/log-expense-receipts-from-google-drive-to-google-sheets, replace each REPLACE_… value as this file says, then run npx zap-pack deploy log-expense-receipts-from-google-drive-to-google-sheets, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
google-driveto the user's Google Drive connection for the account that can read the receipt folder,chatgptto the user's ChatGPT (OpenAI) connection, andgoogle-sheetsto the connection for the account that owns the expense log. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/file-in-folder-v2.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyisfile_in_folder_v2, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect the trigger's fields, the ChatGPT
analyze_image_content_with_visionandconversation_responses_apiactions, and the Google Sheetsadd_rowaction with the user's connections before the first test run, and fix any key inworkflow.tsthat doesn't match.
Test it
Run this sample as a draft test (run_workflow_draft in Zapier MCP), using a test receipt the user uploads to a test folder, not a real one:
{
"id": "1AbCdExampleFileId",
"title": "test-receipt.jpg",
"originalFilename": "test-receipt.jpg",
"alternateLink": "https://drive.google.com/file/d/1AbCdExampleFileId/view",
"file": "https://example.com/test-receipt.jpg"
}
Confirm that one new row appears in the expense log with the time, the file ID, the file name, the receipt link, and the merchant, date, total, currency and category read from the test receipt. If run-status tools aren't available, check the result in Google Sheets directly. The user deletes the test row and the test receipt, not the agent.
Notes
- Every file added to the folder gets a row, including files that aren't receipts. Keep the folder for receipts only, or the log fills with other documents.
- The Zap logs a receipt once per file. Subfolders are ignored unless
includeSubfoldersis set to"true"in the trigger. - Read the extracted amounts before relying on them for reporting. The model can misread a faded or skewed receipt.
- Never commit a real spreadsheet ID, a real Drive folder ID or a real receipt.