Turn a shipping document into a spreadsheet
Shipping documents arrive as PDFs and scans, but the next step usually wants rows: a booking sheet, a customs worksheet or an import into your own system. This recipe reads the goods lines of one invoice or packing list, a PDF or an image, and hands them back as an Excel file, with a column for each value you care about.
Use this templateNeeds an AI connection.
Read the scan and its text
Section titled “Read the scan and its text”The form takes one PDF or image. Extract document text runs OCR on it, so a scan with no text layer still gives the model words to read. The AI Agent gets both: the file under Files, and the OCR Text after the instructions in its User message. That message warns that OCR can drop words and scramble tables, so the model checks the document itself where they disagree. See Read data from a document.
A .txt file or a Word document is refused by the form before any run starts. TIFF and WebP images pass the form, but Extract document text reads only PDF, PNG and JPEG, so the run fails at that step.
Choose the columns
Section titled “Choose the columns”The template reads Description, Quantity, Unit, Gross kg, Commodity code and Origin. Change the AI Agent’s Answer shape to the columns your next step needs. Write Excel writes one column per field, in the shape’s order, so after a change pick the lines again under its Rows: it keeps the columns it had when Rows was picked.
| Value | Read it as | Why |
|---|---|---|
| Quantity, kg | Numbers | So the sheet can add them up and filter on them |
| Commodity code | Text, as written | A number drops leading zeros; the code is checked later |
| Origin | A two-letter country code | Country names are written many ways on the same document |
| Anything else | Left out when the document does not state it | An empty cell is easier to spot than a guessed value |
Hand the file back
Section titled “Hand the file back”The Operation form’s Returned files holds Write Excel’s File, and Returns shows its Row count as Lines. Whoever submits the form gets both on the run’s result. See Make files in a run.
What goes wrong
Section titled “What goes wrong”- A line the AI skipped or merged. Compare Lines with the document’s own line count. To stop a run when they differ, add a Checklist before Write Excel.
- A line OCR misread. The model can copy an OCR error from the Text. The file under Files lets it check, but a smudged scan can still give a wrong number, so compare totals with the document.
- A spreadsheet treated as the truth. The file holds what the AI read. Check codes and quantities before you declare from it, for example with the commodity code check.
Try it
Section titled “Try it”The template comes with a SAMPLE packing list, a scanned-looking PDF, so the first run shows OCR and a real spreadsheet. The AI’s reading depends on your model and documents: try it on real ones.