Skip to main content
All CollectionsExtracting dataAdvanced topics
Understand how Parseur picks a template
Understand how Parseur picks a template

How to work with multiple templates and ensure Parseur always picks the right one

Updated over a week ago

Parseur allows to create as many templates as you have layouts to parse in a single mailbox. When you have more than one template in a mailbox, Parseur will pick the best one automatically, without any further config.

This article describes the standard template selection workflow and how you can tweak it if needed.

Standard template selection workflow

Here is how Parseur selects a matching template for a document.

By design, Parseur can only use a template if it matches 100%. You can check the match ratio of a template using the template debugger.

Step 1: A new document arrives in the mailbox

Step 2: Does the mailbox have zero custom fields and one or more metadata fields?

  • YES: extract data from the document using metadata fields only and set the document status to "Processed" END.

  • NO: Go to Step 3.

Step 3: Is there one or more templates in the mailbox that matches 100%?

  • YES: Pick the template with the most fields(1). If there is more than one template with the most fields, pick the first one we find. Go to Step 8

  • NO: Go to Step 4

(1) how Parseur counts fields:

  • every standard field counts as 1.

  • every table field counts as the number of columns in the table

  • every field with the "Full Name" format counts as 3

  • every field with the "Address" format counts as 6

Step 4: Is the mailbox of a special type (food ordering, real estate, i.e. NOT a custom mailbox)

  • YES: Go to Step 5

  • NO: Go to Step 6

Step 5. Is there a matching template in the linked mailbox managed by Parseur?

  • YES. Pick that template. Go to Step 8

  • NO: Go to Step 6

Step 6: Is the document a spreadsheet or CSV?

  • YES: automatically extract table data from the document. END.

  • NO: Parseur doesn't know what to do with the document. Set Status to "New Template Needed". END.

Step 8: Use to selected template to extract the data and set the document status to "Processed". END.

Can I override a "managed by Parseur" template?

Yes. As described in the workflow above, your local templates always take priority over templates managed by Parseur.

To override a "managed by Parseur" template, simply create a new template locally in your mailbox.

How can I force Parseur to choose another template?

In some cases, the template selection workflow leads to Parseur choosing the wrong template. When this happens, you can tweak the template selection process in several ways.

Option #1: Create a new template with more fields for this type of document

This can be a good solution if you hadn't created a template yet for this document but it is very similar to an existing document that contains fewer fields to extract.

Create a new template based on the new document to capture more fields.

Option #2: Edit an existing matching template to capture more fields than the current matching template

This is a good solution if the template you wanted Parseur to pick contains fewer fields than the one that got picked AND if you can add more fields to the template you want this document to match.

Option #3: Add field constraints to the wrongly matched template to prevent it from matching the current document.

As their name suggests, field constraints are designed to constrain a particular field to follow a certain pattern.

Refer to the following support article for more details on how to work with field constraints.

Did this answer your question?