Inline formatters

Inline formatters enable you to create field-level formatting rules directly within DocAI Studio without creating formatters in Tungsten TotalAgility Advanced Studio. Inline formatters are self-contained, non-reusable rules that are stored as part of the extraction group and apply only to the specific field where they are defined.

Inline formatters include two types:

Simple:

A simple inline formatter applies a single format expression to the field value. Use simple formatters when the formatting logic is straightforward and does not depend on conditions.

For example, you can use a simple formatter to add hyphens to a social security number field, converting 123456789 to 123-45-6789.

Conditional:

A conditional inline formatter applies different format expressions based on conditions. You can define multiple conditional formatting rules, each with its own condition and format expression. The rules are evaluated in order, and the first matching condition is applied. If no conditions match, the field value remains unchanged, and the field is set to valid.

For example, you can use a conditional formatter to format a date field differently based on the document type or country code.

Inline formatters execute during the following operations:

  • Field extraction for training documents

  • Manual entry of field values during scan

  • Automatic extraction from documents

  • Validation when confirming updates to the field

Formatters always execute before validators. If a formatter fails, validation is skipped for that field. This execution order is important to understand when troubleshooting validation issues.

Refer to https://learn.microsoft.com/en-us/dotnet/standard/base-types/formatting-types for more information about the syntax required for formatting condition rules.

When to use inline formatters

Use inline formatters when you need simple, field-specific formatting logic that does not need to be shared across multiple fields or solutions. Inline formatters are ideal for:

  • Formatting field values based on specific conditions

  • Converting extracted values to a standardized format

  • Applying formatting rules that are unique to a single field

For Standard-tier users, inline formatters provide the only way to create custom formatting rules without access to Tungsten TotalAgility Advanced Studio. Advanced and Enterprise-tier users can use inline formatters, reusable formatters, or business rule formatters, depending on whether the formatting logic needs to be reusable.

Note the following limitations when working with inline formatters:

  • One field can have only one formatter. You cannot apply multiple formatters to the same field.

  • Formatters are not supported for bar code fields

  • Formatters are disabled for all tables in predefined document types

  • Inline formatters are non-reusable and cannot be applied to other fields or document types

Field deletion protection

Fields that are referenced by inline formatters cannot be deleted. If you attempt to delete a field that is used as an input to a simple inline formatter or is referenced in an inline formatter condition, the deletion is blocked, and the system displays a message identifying the inline formatter that references the field.

To delete a field that is referenced by an inline formatter, you must first delete or modify the inline formatter to remove the field reference.

When you rename a field that is referenced by an inline formatter, the system automatically updates the reference without breaking the f.

More info