Skip to main content

Document Flags

Tag documents automatically with custom labels based on your business rules

<!-- TODO: Add the main screenshot for this article here - every L2 article needs one. -->

Document Flags let you tag documents with custom labels (called flags) based on business conditions. Flags are applied automatically during document processing: you define the conditions through rules and instructions, and the system applies the right flags to the right documents.

For example, you can set up a rule that flags every invoice over 10,000 USD as HighValue. Each invoice meeting that condition automatically receives the HighValue flag after processing. Flags can then be viewed, filtered, and exported alongside the rest of a document's data. Each flag has its own color, and you can arrange flags in order of priority.


How It Works

Flags must exist before they can be used anywhere. You create them centrally in Main menu → Flagging, which acts as the master list and single source of truth for every flag in your tenant. Once a flag exists, it can be applied to documents automatically during processing through three sources: Transformation Rules, Rejection Rules, and Instruction Builds. Rule-based sources apply flags deterministically, while instruction builds apply them through AI evaluation. When a document is reprocessed, all previously applied flags are cleared and recalculated, so flags always reflect the current state of your rules and instructions.

Creating Flags

Flags are created and managed on the Flagging settings page using + Add New. When you add a flag, you give it a name and a color, and the new flag is added to the end of the list. Each flag in the list shows its color next to its name, and three usage counters for the number of Transformation Rules, Rejection Rules, and Instructions that reference it; clicking a counter navigates directly to those items. For the full procedure, including naming rules and how editing or deleting behaves while a flag is in use, see the Creating and Managing Flags guide.

Flag Colors

Each flag has a color, chosen from a set of preset colors when the flag is created or edited. The flag's pill tags appear in this color across the platform:

  • The Flags column on the document list

  • The Flags section on the document detail and review page

  • The Flags card in the console

  • The flags raised by rules and instructions on the console's Enrichment tab

Changing a flag's color updates it on every document that carries the flag, including finalized documents. Flags created before colors were introduced have no color, and appear with black text on a light gray background until a color is selected.

Ordering Flags

The order of flags on the Flagging page sets their priority, with the first flag as the highest. To change the order, drag a flag by its handle to a new position. The new order is saved automatically and applies to all users in the tenant.

Flags appear in this order wherever they are listed:

  • The Flagging page

  • The flag filter on the document list

  • A document's flags on the document list, the document detail and review page, and in the console

  • Flag markers in XML exports

New flags are added to the end of the list. The list cannot be sorted by column. Reordering requires write access to Flagging and is not available while a search is active.

Applying Flags to Documents

Flags reach documents through three sources during processing:

  • Transformation Rules. When you create a transformation rule, the AI is given your tenant's list of active flags and can generate flag actions (Field = Flag) as part of the rule. If the AI suggests a flag that does not exist in the master list, the system shows a warning directing you to create it first. Multiple flag actions in a single rule are grouped into one row in the rule actions table and displayed as pill tags. At processing time these flag actions fire deterministically, with no AI involved: if the rule matches, the flag is applied.

  • Rejection Rules. You can manually add flag actions to a rejection rule. Each flag action uses Field = Flag, Action = SET, with the value entered as free text (not a dropdown). The AI can also generate flag actions when you create a rejection rule with AI. Because a rejection rule can both reject and flag, a document can be rejected and flagged at the same time. Flag values appear as pill tags in read-only view, and like transformation-rule flags they are applied deterministically at processing time.

  • Instruction Builds. Instruction builds have no separate flags UI; flag conditions are written inline in the instruction text (for example, "If the document source is a specific trading partner, add the PartnerReview flag"). When the instruction is saved, the system scans the text for flag-related phrases, sends the text to the AI with the active flags list, extracts the referenced flags, and matches each against the master list. If a referenced flag does not exist, the save is blocked with an error asking you to create the flag in Settings or remove it. Instruction builds are the only source where flag application involves AI at processing time: the AI evaluates each instruction against the document and decides which flags apply, drawing on both the document's structured data and its raw OCR text.

Applying Flags with CSV Keyword Matching

Transformation Rules and Rejection Rules can also apply flags in bulk by linking a CSV supporting file that holds value-to-flag mappings. Instead of writing one rule per value, you link a CSV whose columns pair the values to match with the flag values to apply, and the system flags documents deterministically at processing time for every row that matches. Flag values taken from the CSV do not need to be pre-created in Main menu → Flagging; values that are not in the master list have no color and appear after the document's other flags. For the full procedure, see the Applying Flags with CSV Keyword Matching guide.

Viewing and Filtering Flags

Applied flags appear in a Flags column on the document list. The first two flags are shown as pill tags in their colors, followed by a +N badge when there are more; hovering over the badge shows the remaining flags. Documents in PROCESSING, RETRYING, FAILED, or SPLITTING status, and documents without flags, show N/A in this column. On the document detail and review page, applied flags appear as pill tags in a bordered container, and in the console they appear on a Flags card. A flag filter in the document list lets you narrow documents to one or more flags. For the filtering procedure, see the Filtering Documents by Flags guide.


Supported Configurations and Options

Flag Naming Rules

Rule

Detail

No spaces

"HighValue" is valid; "High Value" is not

Maximum length

24 characters

Case-sensitive

"HighValue" and "highvalue" are treated as different flags

Editable and deletable

Flags can be recolored at any time, and renamed or deleted while they are not in use

Flag Colors

Option

What it does

Values

Flag color

Sets the color of the flag's pill tags across the platform

Any of the preset colors in the color picker

Permissions

Role

Flagging access

Admin

Read and write

Manager

Read and write

Reviewer

No access

Validator

No access

Reviewer and Validator

No access

Custom role

Read, or read and write, as granted

Flagging is its own module in the role builder. It is not bundled with Transformations, Rejections or Instruction Builds, so a custom role must be granted it separately. The Reviewer, Validator and Reviewer and Validator roles include no settings module, so the Flagging settings page does not appear for them. A role with read access sees the flag list with the add, edit and delete controls grayed out, not hidden, and cannot reorder flags.

Organization Scoping

  • A flag can be scoped to one or more specific organizations.

  • A flag with no organization scope is global and visible to everyone who can see flags.

  • Users mapped to an organization with Self-Service Access enabled see the global flags plus the flags scoped to their own organization.

  • Admins and managers see every flag across all organizations.

  • All users see flags in the order set on the Flagging page.

Data Export Flag Markers

  • Destination format XML templates can include flag markers: <!--FLAG START--><Flag>{flag_name}</Flag><!--FLAG END-->.

  • During export, the {flag_name} placeholder is replaced with the actual flag names applied to the document, in the order set on the Flagging page.

  • If a document has no flags, or the feature is disabled, the entire flag marker block is stripped from the output so no raw artifacts remain.


Other Technical Specifications

Feature Toggle

  • The entire feature is controlled by the Flagging feature toggle.

  • When disabled: the Flagging settings page is hidden, flag columns and filters are hidden, and flag processing is skipped.

Processing Model

  • Transformation Rule and Rejection Rule flags fire deterministically at processing time, with no AI involved.

  • Instruction Build flags are evaluated by AI at processing time; this is the only source where AI is involved in applying flags. The AI uses both the document's structured data and its raw OCR text.

  • On reprocessing, all previously applied flags are deleted before flag application runs again, so results never carry stale data from earlier runs.

Activity Log

  • Flag create, rename, color change, reorder, and delete operations are recorded in the Settings activity log alongside other auditable operations.

  • Example entries: "User created flag 'Fraud'", "User renamed flag 'Tax' to 'TaxReview'", and "User moved flag 'Finance' from position 3 to 4".


Notes

  • Flag names are case-sensitive, so "HighValue" and "highvalue" are separate flags. Pick a naming convention and apply it consistently to avoid accidental duplicates.

  • A flag that is in use by any rule or instruction cannot be renamed or deleted. Its Delete action is grayed out, and when you edit it, the name is grayed out and only the color can be changed. To rename or delete it, remove the references first; clicking a usage counter takes you to them.

  • Deleting a flag also removes it from the documents that carry it.

  • Instruction-build saves are blocked when they reference a flag that does not exist in the master list. Create the flag in Main menu → Flagging first, or remove the reference before saving.

  • If you add a flag with the same name as a flag that was deleted earlier, it keeps the earlier flag's color instead of the color you selected. Edit the flag to change its color.

  • The Flags column, the flag filter, and the console's Flags card are only visible to users with Flagging read permission.

  • Disabling the Flagging feature hides flags everywhere and skips flag processing; flag markers are also stripped from exported output.


Did this answer your question?