QuvanticBook free audit

ZapierChecked blueprint5 nodes

Extract invoice emails into a Google Sheet

Read each invoice email under a Gmail label, pull vendor, number, dates, and total, and log a clean row in Google Sheets.

Portfolio reference build with demo data and placeholder credentials, not a client deployment.

Pain

Stops opening PDFs, typing vendor totals, and hoping nobody pays the same bill twice.

Solution

Read each invoice email under a Gmail label, pull vendor, number, dates, and total, and log a clean row in Google Sheets.

Impact · From the blueprint

About 3 minutes per invoice. At 120 invoices a month that is roughly 6 hours of retyping, plus the month-end hunt for mistyped totals.

Library status: passing. Schema, field mapping, task count, and Code-step unit tests pass. Not built in a live Zapier account.

Extract invoice emails into a Google Sheet step list
Step list

Step inspector

The first step shows the checked-in sample payload.Later steps name the node. They are not a live execution.

Guardrails

No approval, retry, or demo-gate node was detected by name. Read the README before connecting live credentials.

Credential ids in the JSON are placeholders. These files are portfolio demos.

Deploy this for your business

Tell us this slug and what still happens by hand. We will map it onto your accounts. This page is not a claim that the blueprint already runs for a customer.

README

Portfolio demo by Mustafa (mustafaautomation). Not client work. The people, companies, and numbers in it are made up. Rebuild it in your own Zapier account. Nothing here is connected to anyone's account.

Category: Invoices and documents
Difficulty: beginner
Apps: Gmail, AI by Zapier, Code by Zapier, Google Sheets, Paths by Zapier, Slack
Zapier plan: Professional (multi-step Zap: 6 steps after the trigger; Paths by Zapier; AI by Zapier)
Tasks per run: 4 typical, 5 at most
Test status: passing (schema, mapping scope, task count, Code step unit tests)

Problem

Someone in the office opens every supplier email, finds the total, and retypes vendor, invoice number, due date, and amount into the payables sheet. It takes a few minutes each, the totals get mistyped (European "1.280,00" becomes 1.28), and invoices that only exist as a scanned PDF get logged with a guessed number.

Who it's for

Small teams and freelance bookkeepers who already label invoice mail in Gmail and track payables in a Google Sheet before anything goes into the accounting system.

How the Zap runs

flowchart TD
  s1["1. Gmail: New Labeled Email<br/>New email under the Invoices label"]
  s2["2. AI by Zapier<br/>Pull the invoice fields"]
  s1 --> s2
  s3["3. Code by Zapier<br/>Turn the printed total into cents"]
  s2 --> s3
  s4["4. Google Sheets<br/>Log the invoice row"]
  s3 --> s4
  s5{"5. Paths by Zapier<br/>Clean row or needs a person"}
  s4 --> s5
  s6["6. Gmail<br/>File the email as logged"]
  s5 -->|"Logged"| s6
  s7["7. Slack<br/>Ask a person to check the row"]
  s5 -->|"Needs review"| s7

Build it in the Zapier editor

Zapier has no import file for a Zap like this one, so it is built by hand from the steps below. zap.json is the same Zap in a machine-readable form (schema), and zap.yaml is the same document in YAML.

A value like [2. vendor] means: click the field, open step 2 in the data picker, and choose vendor. Plain text is typed as shown. YOUR_... is a value from your own account.

Before you start

  • Create the sheet Payables › Invoices with these headers in row 1: received_at, from_email, vendor, invoice_number, invoice_date, due_date, amount, currency, what, needs_review, text_found, gmail_link.

Steps

1. Trigger: New email under the Invoices label

App: Gmail · Event: New Labeled Email · polling (Zapier checks on your plan's update interval) · Tasks: 0

Fires for each email you (or a Gmail filter) put under the Invoices label. Labelling first keeps newsletters and receipts out of the payables sheet.

FieldValue
LabelInvoices

Fields this library maps from the trigger: message_id, thread_id, from_email, from_name, to, subject, date, body_plain, snippet, labels, attachment_count, attachment_names. Zapier shows them with its own labels; pick the one with the same meaning.

2. Action: Pull the invoice fields

App: AI by Zapier · Event: Analyze and Return Data · Tasks: 1

Asks for the fields as named outputs. The prompt forbids guessing and asks whether the figures are actually in the email text, because Gmail gives Zapier the message body, not the text inside a PDF.

FieldValue
ModelDefault (fast)
InstructionsYou read supplier invoices for an accounts-payable team. From the email below, return: vendor (the company that sent the invoice), invoice_number (exactly as printed), invoice_date and due_date (YYYY-MM-DD, empty if not stated), total_text (the grand total exactly as printed, with its currency symbol or code, for example "$1,280.00" or "1.280,00 EUR"), currency (ISO code if you can tell, otherwise empty), line_summary (one short line describing what was bought), and text_found ("yes" if the email text actually contains the invoice figures, "no" if the figures are only inside an attachment you cannot read). Never invent a number. If a value is not in the text, leave it empty.
Input dataFrom: [1. from_name] <[1. from_email]>
Subject: [1. subject]

[1. body_plain]
Output fieldsvendor, invoice_number, invoice_date, due_date, total_text, currency, line_summary, text_found

Later steps can map: vendor, invoice_number, invoice_date, due_date, total_text, currency, line_summary, text_found.

3. Action: Turn the printed total into cents

App: Code by Zapier · Event: Run JavaScript · Tasks: 1

Parses US, European, and Swiss number formats into an exact amount in cents and flags anything ambiguous, such as "1,280" with no decimals.

Paste the whole of code/parse-money.js into the code box. Source: content/code/parse-money.cjs. Unit tests: content/code/parse-money.test.cjs.

Input Data keyValue
amount_text[2. total_text]
currency_hint[2. currency]

Returns: amount, amount_fixed, amount_cents, currency, format, needs_review.

4. Action: Log the invoice row

App: Google Sheets · Event: Create Spreadsheet Row · Tasks: 1

Every invoice gets a row, including the ones that need a person, so nothing is silently dropped.

FieldValue
DriveMy Google Drive
SpreadsheetPayables
WorksheetInvoices
Columns › received_at[1. date]
Columns › from_email[1. from_email]
Columns › vendor[2. vendor]
Columns › invoice_number[2. invoice_number]
Columns › invoice_date[2. invoice_date]
Columns › due_date[2. due_date]
Columns › amount[3. amount_fixed]
Columns › currency[3. currency]
Columns › what[2. line_summary]
Columns › needs_review[3. needs_review]
Columns › text_found[2. text_found]
Columns › gmail_linkhttps://mail.google.com/mail/u/0/#all/[1. message_id]

Later steps can map: id, row_number.

5. Paths: Clean row or needs a person

App: Paths by Zapier · Event: Split into paths · Tasks: 0

The row exists either way. The paths decide whether the email is filed as logged or flagged for a person to open the PDF.

Zapier runs every path whose rule matches, so more than one path can run. Nothing can follow a Paths step, so each path ends the run on its own.

Path A: Logged. Rule: [3. needs_review] (Boolean) Is false and [2. text_found] (Text) Exactly matches yes. This is the usual path.

6. Action: File the email as logged (path A)

App: Gmail · Event: Add Label to Email · Tasks: 1

Moves the email under Invoices/Logged so the Invoices label only holds work still to do.

FieldValue
Message[1. message_id]
LabelsInvoices/Logged

Later steps can map: id.

Path B: Needs review. Rule: ([3. needs_review] (Boolean) Is true) or ([2. text_found] (Text) Does not exactly match yes).

7. Action: Ask a person to check the row (path B)

App: Slack · Event: Send Channel Message · Tasks: 1

Posts the row number and the reason so a person can open the PDF and fix the amount by hand.

FieldValue
Channel#accounts-payable
Message TextInvoice from [2. vendor] needs a look (row [4. row_number]). Amount read as "[2. total_text]", format [3. format], figures in email text: [2. text_found]. Subject: [1. subject]
Send as a bot?Yes
Bot NameZap alerts
Include a link to this Zap?No

Later steps can map: ts, permalink.

Test it

Use sample-trigger.json as the test record. For an instant or webhook trigger, send it to the trigger once; for a polling trigger, create a matching record in the app and click Test trigger. Then test each step in order and read its output before you turn the Zap on.

{
  "message_id": "18c2f4a9b7d01e55",
  "thread_id": "18c2f4a9b7d01e55",
  "from_email": "accounts@harbor-goods.example",
  "from_name": "Harbor Goods Accounts",
  "to": "ap@northwind-studio.example",
  "subject": "Invoice INV-001842 from Harbor Goods",
  "date": "2026-11-24T09:14:03Z",
  "body_plain": "Hello Northwind Studio team,\n\nPlease find invoice INV-001842 for the November studio supplies order.\n\nInvoice date: 2026-11-21\nDue date: 2026-12-21\nItems: 40 x linen aprons, 25 x stoneware mugs\nTotal due: $1,280.00\n\nBank details are on the attached PDF.\nThanks,\nHarbor Goods Accounts",
  "snippet": "Please find invoice INV-001842 for the November studio supplies order.",
  "labels": "INBOX, Invoices",
  "attachment_count": 1,
  "attachment_names": "INV-001842.pdf"
}

Plan and task usage

StepAppTasks
1. New email under the Invoices labelGmail0
2. Pull the invoice fieldsAI by Zapier1
3. Turn the printed total into centsCode by Zapier1
4. Log the invoice rowGoogle Sheets1
5. Clean row or needs a personPaths by Zapier0
6. File the email as loggedGmail1
7. Ask a person to check the rowSlack1

A typical run uses 4 tasks; the upper bound is 5, when every filter passes and the costliest paths run. Zapier does not charge tasks for triggers, Filter, Paths, Formatter, Delay, Looping, Digest, Storage, or Zapier Tables steps. AI by Zapier is counted here as 1 task; Zapier prices it by model tier, so a larger model can cost more.

Minimum plan: Professional, because of: multi-step Zap: 6 steps after the trigger; Paths by Zapier; AI by Zapier. The Free plan only runs two-step Zaps (a trigger and one action) and leaves out Filters, Paths, Formatter, webhooks, AI by Zapier, and premium apps.

Customize

  • Point the trigger at your own label. A Gmail filter such as has:attachment (invoice OR "amount due") can apply it for you.
  • Add a category output to the AI step and a column for it if you split payables by cost centre.
  • Swap Slack for Microsoft Teams if that is where the finance team works; the message text maps the same way.

Limits

  • Gmail passes the email body, not the text inside a PDF or image. Image-only invoices come through with text_found = no and land in the review path instead of getting an invented total.
  • AI by Zapier can misread a badly formatted email. The sheet keeps the raw total_text next to the parsed amount so a person can compare.

Time saved

About 3 minutes per invoice. At 120 invoices a month that is roughly 6 hours of retyping, plus the month-end hunt for mistyped totals.

Files

FileWhat it is
zap.jsonThe Zap, step by step, in schema 1.0.0.
zap.yamlThe same document in YAML.
sample-trigger.jsonFictional trigger record for the first test.
diagram.pngThe step list, drawn like the Zapier editor.
code/parse-money.jsPaste-ready Code by Zapier step.