How to build an Invoice Parsing Tool on Airtable (AI)
Mar 5, 2025

A friend of mine was spending over 2 hours a day manually typing out invoice details into a spreadsheet, copying numbers and line item descriptions one by one.
Built this super simple set up and he’s completely blown away by how much time it saves. That inspired to make this video and share it here.
Current use case:
1. Upload Invoice.
2. Automation uses AI to extract Invoice Line Item Descriptions, Quantity and Totals.
3. Automation creates corresponding records with precise information.
4. My friend can now get all insights from the invoices his company receives (how much they’re spending, what they’re spending on, and a clear picture of overall finances).
SCRIPT BELOW!// Retrieve the configuration inputs from the automationlet config = input.config();let invoiceJson = config.invoiceJson;let recordID = config.recordID;
// If invoiceJson is passed as a string, parse it into an objectif (typeof invoiceJson === "string") { try { invoiceJson = JSON.parse(invoiceJson); } catch (error) { throw new Error("Failed to parse invoiceJson: " + error.message); }}
// If invoiceJson is not an array, check if it's an object with an "invoices" key that is an arrayif (!Array.isArray(invoiceJson)) { if (invoiceJson.invoices && Array.isArray(invoiceJson.invoices)) { invoiceJson = invoiceJson.invoices; } else { throw new Error("invoiceJson is not an array or does not contain an 'invoices' array."); }}
// Build an array of line item objects from the invoiceJson datalet lineItems = invoiceJson.map(item => ({ "Description": item.description, "Quantity": item.quantity, "Amount": item.amount, // If you need to pass the invoice record ID along, include it as needed. "Invoice": recordID}));
// Output the list of line items so subsequent steps can access itoutput.set("lineItems", lineItems);
Get our 7-days course for free, and learn Airtable tricks and tips by solving real use cases.