GOOGLE DRIVE RECEIPT READER
Upload a receipt.
Get a row in Sheets.
Enter your folder, your sheet and your Gemini key, then copy one script.
Upload receipt photos on a simple page, or drop them in a Drive folder and let it read them for you.
Before you start
- One Google Drive folder that will receive the receipt photos
- One new Google Sheets file for the results
- A Gemini API key from Google AI Studio
- Three sample receipts from three different shops
You must own the folder and the sheet, or be allowed to read the folder and edit the sheet.
Install and test
- Open your results sheet, choose Extensions → Apps Script, paste Code.gs and save.
- Choose processReceipts and press Run. Allow the permissions Google asks for. If the folder is empty it will say "No new receipt images", which is fine.
Option A — Upload page (easiest)
- In Apps Script choose Deploy → New deployment. Click the gear and pick Web app.
- Set Execute as: Me and Who has access: Only myself. Do not choose Anyone, because anyone with the link could use your Gemini key. Then click Deploy and allow the permissions.
- Open the Web app URL, choose one or more receipt photos and press Read receipts. Each result appears in the table and as a new row in the Receipts tab.
- If you change the code later, save it and choose Deploy → Manage deployments → Edit → New version → Deploy.
Option B — Automatic folder watcher
- Upload a sample receipt to your Drive folder, run processReceipts and check the first row in the Receipts tab.
- Choose installTrigger and press Run once. The script now checks the folder every minute and reads each new photo.
- Upload a new receipt, wait a few minutes and check for the new row. Share only the receipt folder with other people, never the sheet or the script.
- When you are done, run removeTrigger to stop the automation.
Both options use the same sheet and never read the same file twice. Each folder run reads at most 3 new files. Rows marked "Needs review" are missing at least one value, so compare them with the original image. Always check the results against the original receipt.