Getting started guide · Step 4 of 5
A parsing rule tells Docparser which piece of data to pull from a document, such as an invoice date, a total or a table of line items. You usually create one rule for each field you need.
What is a parsing rule?
Each parsing rule extracts one piece of data from your documents. Typical examples are an invoice date, a total amount, or the line items in a table.
How parsing rules work
Every rule follows the same three steps:
- Choose the kind of data you want.
- Show Docparser where to find it.
- Optionally, clean up the result with filters.
Create your first parsing rule
1. Add a rule
Click Create First Parsing Rule, or Add Parsing Rule if your parser already has rules.
2. Choose a preset
Pick the preset that matches your data. For single values like an invoice number, use Text Fixed Position or Text Variable Position. For tables, use Table Data.
Docparser also suggests presets for your document type, such as invoices, purchase orders and bank statements. You'll find generic presets for flexible extraction and advanced presets for more control.
Tip
Presets are shortcuts
Each preset comes with its own starting filters. Text Fixed Position (select an area), Text Variable Position (find a keyword) and Table Data (pick a table) cover most needs.
3. Show Docparser where the data is
There are three main ways to select data. Pick the one that fits your document.
Click and drag
Use this when the data is in the same place on every document. Highlight the area you want. It works best for documents with a consistent layout that aren't scans.
Use a keyword
Use this when the value moves around but always has a label next to it, such as Invoice Number, Total or Date.
Use a table rule
Use this for repeating rows, such as line items, transactions or lists. It's the best choice when you need many rows from the same area.
Which one should you use?
| Your data | Method | Preset |
|---|---|---|
| Always in the same position | Click and drag | Text Fixed Position |
| Has a label next to it | Keyword | Text Variable Position |
| Several repeating rows | Table rule | Table Data or Line Items |
| Something else | Browse the full list of presets. Some advanced presets find data without a fixed position. | |
Tip
Single values or tables?
Rules come in two kinds. Single-value rules pull one item, such as a date, total or reference number. Table rules pull repeating data, such as line items or rows.
4. Refine your results (optional)
If the extracted data needs adjusting, add filters to:
- remove unwanted text
- format dates or numbers
- keep only part of a value
Filters are covered in more depth in What filters are available in Docparser?
See it in action
This screencast walks through creating a first parsing rule, step by step.
Need help?
Our support team is happy to help you set up your rules. Submit a request and include a sample document.