Sync distinct invoice IDs from CSV and loop line items

Recipe ToolsData ParserDatabase

What it does

When a scheduled time arrives, this automation imports a CSV file into a collection and extracts unique invoice IDs. It then loops through each invoice to gather all related line items for batch processing.

Who it's for

Accounting teams who need to organize invoice and line-item data from CSV files for batch processing or reconciliation.

How teams use this

Organize invoices for batch reconciliation

Import a CSV with mixed invoice and line data, extract unique invoices, and group line items by invoice ID so the team can reconcile in bulk without manual sorting.

Feed invoice data to a downstream system

Parse the CSV, deduplicate invoices, and loop through line items to send each grouped invoice and its lines to an ERP or accounting platform for posting.

Generate an invoice summary report

Extract distinct invoices and their line counts from the CSV, then set up a summary table showing invoice ID, product count, and total line items per invoice.

How it works

  1. Run on a specified interval. This automation starts at a scheduled time so invoice data is processed regularly without manual intervention.
  2. Parse the CSV file. Read the CSV containing invoice IDs, line IDs, and product names, then load the data into a collection for querying.
  3. Extract distinct invoice IDs. Query the collection to find unique invoice IDs so each invoice is processed only once, even if it has multiple line items.
  4. Loop and gather line items. For every distinct invoice ID, query the collection again to retrieve all line items belonging to that invoice and build a table.