The AI Bulk Extraction action reads every line item of a long PDF into a CSV document, with the columns you choose. It is built for documents too long for the other AI extraction actions: a telecom bill of thousands of pages with a block of charges for every location, a statement with hundreds of accounts, an aged payables report, any long list. Each printed line item becomes one row of the CSV, and each row also carries the values printed above it (the location, vendor or account it belongs to) and the values printed once for the whole document (the account number, the bill date).


No Records or line items are created. The CSV is saved on the Record as a document, ready for a CSV Line Loop, a download, an email or an import.


AZURE ONLY: This is an AI action and runs only on Azure-hosted / AI-licensed sites.

Setting it up

  1. Create a workflow step for the extraction and add AI Bulk Extraction as its incoming action.
  2. On the Document(s) tab, choose the PDF to read.
  3. On the Extraction tab, add a column for every value you want in the CSV, in the order you want them, and say where each one is printed. To get a starting point, click Suggest Settings with AI at the top of the tab, upload a sample PDF and apply its suggestion.
  4. Assign the step to docMgt_Agent. The action shows a warning with an Assign to docMgt_Agent button while the step is unassigned.
  5. Give the step a default Complete button and put the follow-up actions (a CSV Line Loop over the new CSV, an email) on it.


The PDF must have a text layer - most bills, statements and reports produced by software do. A scanned PDF has no text layer; run OCR on it first, and the action reads the OCR text instead.


Columns

Every column has a name, which becomes its heading in the CSV, and says where its value is found:

  • Line - printed on the row itself: a description, a date, an amount. At least one Line column is required.
  • Group - printed in the heading above a block of rows: a vendor, a location, a sub-account, a section. Every row in the block gets the value, including rows that run onto the next page.
  • Document - printed once for the whole document, usually on the first page or at the top of every page: an account number, an invoice number, a statement date. Every row gets the value.
  • Value or Variable - not read from the PDF. The value is worked out for each row after the extraction, and can use the row's other columns.


Each Line, Group and Document column can have a hint that says which printed value to use when there is more than one. Name the printed column heading: "the Balance Due column, not the aging buckets", "the amount on a tax or fee line". If you add an example, make one up; a real value from one of your documents can end up copied into rows where it is not printed.


A Value or Variable column can use any variable, plus these for the row it is on:

  • [CSV:Column Name] - the value of another column on the same row, for example [CLEANCUR([CSV:Amount])].
  • [CSVAN:Column Name] - the same, for a column name with characters other than letters, numbers and spaces left out.
  • [LINECTR] - the row number in the CSV.
  • [PAGECTR] and [PAGECOUNT] - the page of the PDF the row is printed on, and the number of pages in the PDF.


Value or Variable columns are worked out in column order, so a later one can use an earlier one. A value that uses none of these is worked out once for the whole CSV rather than once per row.


Suggesting the settings with AI

The columns, Skip and Extra Instructions take some thought on a new kind of document. The AI can read a sample PDF and suggest all three for you to review.

  1. Click Suggest Settings with AI at the top of the Extraction tab. The suggestion panel opens; close it with its X when you do not need it.
  2. Under Sample PDF, choose a text-searchable PDF of the kind the action will read, 10 MB at most. A whole bill is fine; only a few of its pages are read.
  3. Optionally, say in What You Want what you need from the document, for example "One row per charge, with the location and the amount". Without it, the AI suggests the columns a person would usually want for each line item.
  4. Click Suggest Settings. After a few seconds the suggestion is shown: the columns with where each is found and its hint, the Skip and Extra Instructions, a short note on how the document is laid out and what to check, and any warnings.
  5. Click Apply to use it, or Discard. Apply replaces all the columns - Value or Variable columns too - and the Skip and Extra Instructions, and closes the panel; when the action already has settings it asks first. Nothing is saved until you save the action.


The AI reads the first three pages, two from the middle and the last two, passing over blank pages, so a document of thousands of pages takes no longer than a short one. When a section you need is not on those pages, list the pages to read in Sample Pages, for example "1-2, 140". The PDF is only read - it is never saved on the Record or anywhere else.

Treat the suggestion as a starting point. It is made from a few pages, so it can miss a section that appears only elsewhere in the document - most often an exception to Skip, such as taxes itemized only inside a summary block that is skipped. Read the note and the warnings, run the action on a real document, and check the CSV against the PDF before relying on it. Add Value or Variable columns yourself after applying; the AI does not suggest them.


Suggesting uses Configuration AI tokens, not Automation tokens. It is offered to administrators when Configuration AI is on for the site.


What the action writes

The CSV has your columns in your order, followed by two more:

  • Page - the page of the PDF the row is printed on. This is the page number in the PDF, not the page number printed on the page.
  • Flags - empty when the row looks right. Otherwise it says which value could not be found on the row's page, for example "Amount not found in page text".

Each PDF gets its own CSV. The action also writes these values to the Record, replacing any left by an earlier run:

  • AIBulk_Summary - a short summary: rows, pages, the CSV file names, flagged rows, pages with no text, and parts that could not be read.
  • AIBulk_RowCount - the number of rows written.
  • AIBulk_PageCount - the number of pages read.
  • AIBulk_SkippedPages - the number of pages with no text to read.
  • AIBulk_FlaggedCount - the number of flagged rows.
  • AIBulk_Flags - the parts of the document that could not be read, the pages with no text, and the flagged rows, most important first.


Checking the results

Every value the AI writes into a row is checked against the text of the page it came from, word by word. A row with a value that is not there is flagged rather than dropped, so nothing disappears quietly. Look at flagged rows first: a flag usually means a value came from the wrong place, or that a hint's example was copied in where it is not printed.


Values are copied exactly as printed, including currency symbols, minus signs and CR markers ("$-53.33", "93.63 CR"). Convert them with a Value or Variable column, or in the actions that use the CSV.


How the action runs in a workflow

A long PDF takes minutes to read, so the extraction is done by an AI job that runs in the background, the same way AI/OCR/Barcode Processing works. Place the action as a step's incoming action and assign that step to a user - preferably docMgt_Agent. The workflow item then waits at the step while the job runs. When the job finishes it saves the CSV, writes the AIBulk_ values and completes the waiting item with the step's default Complete button. If the step has no default Complete button, the item still moves on from the step when the job finishes.


The step must be assigned for the workflow to wait. If it is not assigned to anyone, the workflow moves on as soon as the job is queued, the CSV is not there for the steps that follow, and the job finds no workflow item to complete. The action shows a warning when its step is unassigned, with a button that assigns it to docMgt_Agent for you.


Put follow-up work on the step's Complete button rather than after the action in the same action list; actions listed after it run right away, before the CSV exists.


Each job is listed on the AI Workflow Processing report from the moment it is queued, with its status, and with its tokens and timing once it has run. A job that could not run is shown there with the reason. Nothing is emailed.


Running the action from an Add-In button extracts in the same way; the CSV arrives on the Record shortly afterward, and there is no workflow item to complete.


Options

Document(s)

Active Document - When on, the action reads the Active Document if there is one.

Found Documents - Read the first document matching the Category, SubCategory and Name below, or all of them. Each PDF gets its own CSV.

Cat/Sub/Name - The Category, SubCategory and Name of the PDF to read.

Pages to Read - Optional. Limit which pages are read, for example 1-50 or 1,3,5. Blank reads every page.

Extraction

Suggest Settings with AI - Opens the suggestion panel: upload a sample PDF to get suggested columns, Skip and Extra Instructions to review and apply. See Suggesting the settings with AI above.

Columns - The CSV's columns, in order. Drag a column by its handle to move it. For each column, enter its Name, choose where it is Found In, and enter a hint (or, for a Value or Variable column, the value).

Skip - Optional. Sections or text to leave out: an account summary, a payment coupon, a summary table that repeats the itemized lines, typed notes. Page headers and footers, column headings, page numbers, totals and subtotals are never rows, so they do not need to be named.

Extra Instructions - Optional. Rules about what counts as a row ("Payments and deposits are not rows. Late fees are rows."), or the printed order of several amounts on one line.

Output

CSV Document - The Category, SubCategory and Name the CSV is saved with. Blank uses the PDF's own; enter # to leave a value blank.

File Name - The CSV's file name. Blank uses the PDF's file name with .csv.

Replace Existing - When on, running the action again saves a new revision of the CSV with the same Category, SubCategory and Name instead of adding another one.

AI Level

Quality - Economy is recommended: the action sends the PDF's text, not images of its pages, and Economy reads most bills and reports well at a fraction of the cost. Use Balanced when Economy puts values in the wrong columns on an unusual layout.

Results

Lists the AIBulk_ values the action writes and how the workflow item is completed.

TIPS

On a new kind of document, start with Suggest Settings with AI, then adjust what it suggests rather than writing every column from scratch.


Start with one document and the AI Workflow Processing report open. Read the first CSV against the PDF, look at the flagged rows, and adjust the hints, Skip and Extra Instructions before running it on a large batch.


Many bills print the same charges twice: once in a summary near the front and again itemized under each location. Name every summary in Skip, or its lines become rows too. Then check that nothing you need is printed only inside a section you skipped; if it is, say so in Skip ("except the itemized tax lines inside each location's summary").


When a line prints several amounts (balance due and aging buckets, recurring and one-time charges), make one column for each amount and name its printed column heading in the hint. If amounts still land in the wrong columns, give their printed order in Extra Instructions: "Each line prints five amounts in this order: Balance Due, Current, 31-60 Days, 61-90 Days, Over 90 Days."


Use Group columns for whatever identifies a block of rows, and prefer a number to a name where both are printed - a sub-account number is more reliable for sorting and matching than a store name.


Pages with no text - blank pages, or scanned pages in a PDF that was never OCR'd - are counted in AIBulk_SkippedPages and listed in AIBulk_Flags.


NOTE ON (AI): Reading documents with AI consumes tokens and may incur extra fees. Workflow tokens are billed separately from End-User or Admin tokens — check with your sales rep for more information. Please verify all results, as AI can make mistakes.