Library / Documents, PDF & OCR
Documents, PDF & OCR
Match supplier invoices to purchase orders with Gmail, OpenAI, and Data Tables
When a new email arrives, it reads and extracts data from documents with OpenAI / ChatGPT using Data Table, Gmail.
What it does
## Match every supplier invoice against the purchase order before it gets paid The invoice arrives as a PDF on an email. This reads it, finds the purchase order it belongs to, and stops the ones that do not line up - duplicates, overcharges, and invoices for something nobody ordered. ### How it works Read The PDF turns the attachment into text and Pull Out The Invoice Fields asks a model for the invoice number, vendor, PO reference, currency and total exactly as printed. It is never asked for a number: 1.234,50 and 2,600.00 are both real, and parseFloat reads the first as 1.234. Parse The Money decides the separator by which one comes last. Match It Against A Purchase Order finds the PO by reference, or by vendor and amount when the invoice quotes none. Vendor names compare with the suffixes stripped, so Nordwind Analytics BV and Nordwind Analytics are one supplier. Then four checks: already seen, wrong currency, over tolerance, no order at all. Clear invoices are logged and you hear nothing. Everything else gets a written reason, a row in the table, and a draft reply in the supplier's own thread for you to read and send. ### Setup 1. A Gmail credential, and a label your supplier invoices land on. 2. A Data Table called purchase_orders with columns po_number, vendor, amount, currency and status. Put your open POs in it. 3. A Data Table called invoices_seen with columns invoice_key, invoice_number, vendor, amount, currency, po_number, status, reason and seen_on. 4. An OpenAI-compatible key on the model node, and your tolerance in Settings.
The steps
- Watch The Invoice Label
- Settings
- Keep Only The PDFs
- Is There An Invoice Attached?
- Read The PDF
- Pull Out The Invoice Fields
- Model
- Parse The Money
- Read The Open Purchase Orders
- Read The Invoices You Have Seen
- Everything In Hand
- Match It Against A Purchase Order
- Is It Clear To Pay?
- Log It As Cleared
19 steps in total.
Similar automations
Finance, Invoices & AccountingExtract and post supplier invoices with AI, routing exceptions for review16 stepsE-commerce & PaymentsRoute store webhook orders to supplier, shipping, CRM and ERP with stock checks24 stepsDocuments, PDF & OCRProcess Purchase Orders from Outlook Excel Files with OpenAI16 stepsForms & SurveysVerify Polish VAT White List supplier accounts with forms and Data Tables12 steps