In this lesson
You are the one who checks the total.
The AI reads an invoice and fills in the spreadsheet. But a wrong amount becomes a wrong payment. Today you learn to save time without losing control.
- Take the data from the file to the spreadsheet
- Ask for the right fields, with a clean date and number
- Check before you trust
The repair shop case
A repair shop receives 40 supplier invoices a month, as PDFs and as photos. Dona Rita types in supplier, date and amount, one by one. Each invoice takes 4 minutes. That is almost 3 hours a month.
The idea: the AI reads and fills in. Dona Rita only checks.
Three paths from the file to the text
- PDF with text: a node extracts the text directly. It is the cheapest.
- Scanned PDF or photo: the AI reads the image.
- Large file: there is a size limit. If the file goes over it, the flow fails.
Look at your email too: large attachments may not even reach the flow.
The extraction request
The "null" is important. Without it, the AI tries to guess a field that does not exist.
Date and number also call for care. Ask for the date as 2026-03-04, and the total as 1250.00. That way the spreadsheet does not swap day with month, or comma with point.
What the pros know
When you send a photo to the AI, the file goes, but its name and its hidden data (metadata) do not. The OpenAI documentation says the model does not process the original file name or the metadata. So if the date of the photo is only in the name ("invoice-04-03.jpg"), the AI never saw it. People with practice pass this data in writing in the request itself, such as "this invoice was received on 2026-03-04". Another precaution comes from Zapier: if an ordinary file field receives several files separated by commas, only the first one is sent and the others are ignored without warning.
Documents that arrive in Brazil
Each document has its own fields. Nota fiscal (the official Brazilian invoice): supplier, CNPJ (the company tax ID), date and total. Boleto (a bank payment slip): payee, due date and amount. Pix receipt (Pix is Brazil's instant payment system): who paid, amount and date. Create one request for each type, instead of a single request for everything. The result is more accurate and easier to check.
If the document is not of the expected type, the flow should send the row to a "Review" tab, and not try to guess.
The Checked column
Create a column in the spreadsheet called Checked, which starts empty. The flow fills in the others and leaves this one blank. When Dona Rita matches the amount against the paper invoice, she writes "ok".
House rule: a row without "ok" does not go to payment.
Test this too: create five made-up documents, one of them with an invalid CNPJ on purpose. The AI should return what is written, and the check catches the error.
Testing with ten documents
Mix them: five good invoices, two crooked photos, an empty PDF, a boleto and a document that has nothing to do with any of this. Write down, field by field, what came out right, what came back null and what came back wrong. An error that looks right is the most dangerous kind. It only shows up when you compare with the paper.
Careful
An invoice issued to an individual has a CPF, the Brazilian individual taxpayer number, which is personal data. On a free API quota, the text may be used by the provider. Use a paid service or delete the CPF first.
Practice · 10 min
- Create five made-up documents in plain text, one with an invalid CNPJ on purpose.
- Run the request from this lesson on each one. Write down whether each field came out right, null or wrong.
- Create the Checked column and decide who fills it in.
Summary
- A file is data: a PDF with text, an image and a large file take different paths.
- Ask for JSON, with "null" when a field is not found and without making anything up.
- Date in year-month-day; number with a decimal point.
- The model does not see the file name or the metadata.
- Checked column: a row without "ok" does not go to payment.
Sources
Read on October 30, 2026.
- OpenAI. Images and vision: file name and metadata are not processed
- Zapier. Send files in Zap workflows: several files in one field
- Anthropic. PDF support: PDF as text and as image
- IETF. RFC 3339: date format
- Brazil. Lei 13.709/2018 (LGPD), Brazil's data protection law: articles 5, 6 and 46
Lesson quiz
Three situations to apply what you learned.
Isaque Victor free courses