πŸ“— Optional (Empty) Fields

This article applies only to Parsio’s template-based parser.

In some cases, certain fields may not appear in every email or document. By design, Parsio must find all fields defined in a template for a document to be considered successfully parsed.

If a field is missing, the document will be marked as Failed to process.

There are two main ways to handle this.

Option 1: Create multiple templates (recommended)

In most cases, this is the best and most reliable solution.

Parsio allows you to create multiple templates within the same inbox. When processing a document, Parsio:

  1. Tries the template with the highest number of fields

  2. Falls back to the next template if parsing fails

  3. Continues until a matching template is found

Using this approach, you can:

  • Create one template that includes all fields

  • Create one or more additional templates that omit optional fields

This ensures reliable parsing without relying on complex rules.

Option 2: Use a field mask

You can also use a more advanced technique to mark fields as optional by adjusting the field’s mask.

How it works

By default, Parsio uses the following regular expression to extract field values: .+?

This expression means: β€œMatch one or more characters.”

If a field is missing, this match will fail.

To allow empty values, select Custom regex and use: .*?

This expression means: β€œMatch zero or more characters.”

This allows the field to be empty without causing the entire template to fail.

Recommendation

While the field mask approach can be useful in some cases, it depends heavily on document structure.

Whenever possible, we recommend Option 1 (multiple templates) for better reliability and maintainability.


Was this article helpful?
© 2026 Parsio Knowledge Base