Data Rule (Node Type)

From Grooper Wiki
Revision as of 14:32, 15 April 2026 by Rpatton (talk | contribs)

This article is about the current version of Grooper.

Note that some content may still need to be updated.

2025 20232021


flowsheet Data Rules are used to normalize or otherwise prepare data collected in a data_table Data Model for downstream processes. Data Rules apply conditional logic to data extracted from documents (folder Batch Folders).

  • Each Data Rule executes a "Data Action" which do things like computing a field's value, parse a field into other fields, perform lookups, and more.
  • Data Actions can be conditionally executed based on a Data Rule's "Trigger" expression.
  • A hierarchy of Data Rules can be created to execute multiple Data Actions and perform complex data transformation tasks.

WIP

This article is a work-in-progress or created as a placeholder for testing purposes. This article is subject to change and/or expansion. It may be incomplete, inaccurate, or stop abruptly.

This tag will be removed upon draft completion.

Introduction

A Data Rule is a configurable rule that applies conditional logic to extracted data. Data Rules are typically used after extraction to transform values into the format your downstream systems require, or to enforce business requirements that are easier to express as a rule than as extraction logic.

Unlike extractors (which focus on finding data on the document), Data Rules focus on fixing, moving, combining, and validating the data once it has been captured into a Data Model.

What a Data Rule runs against (scope)

A Data Rule runs against instances of a selected container. The container is chosen using the rule's "Scope" property:

  • If the "Scope" is set to a Data Model, the rule executes once on the root document instance.
  • If the "Scope" is set to a Data Section (and the section is multi-instance), the rule executes for each section record (each Section Instance).
  • If the "Scope" is set to a Data Table, the rule executes for each row (each Table Row Instance).

This is important because many Data Actions operate on fields within the current record/row, and the meaning of “source” and “target” depends on what the rule is scoped to.

Conditional execution (Trigger, True Action, False Action)

A Data Rule can optionally use conditional logic to decide what should happen:

  • The "Trigger" property must be configured with a Boolean expression.
  • When "Trigger" evaluates to True:
    • The "True Action" runs.
    • Any child Data Rules (nested under the current rule) also run.
  • When "Trigger" evaluates to False:
    • The "False Action" runs (if configured).
    • Child Data Rules are skipped.
    • If no "False Action" is configured, the Data Rule just does not run.

If the Trigger property is blank, the Data Rule will always run.

How Data Rules differ from other conditional components

Data Rules are purpose-built for manipulating and validating extracted values inside the Data Model hierarchy (document, section record, or table row). There are other Grooper components that also use conditional logic (for example, conditional paths in a Batch Process), but those typically control workflow routing or when a step runs. Data Rules control how extracted data is modified within the document's data structure.

how to configure a Data Rule (step-by-step)

  1. In Grooper Design, create or select a Data Rule (commonly stored in a Content Type's Local Resources Folder).
  2. Select the Data Rule and set:
    1. "Scope" to the Data Model, Data Section, or Data Table you want to process.
    2. (Optional) "Trigger" to define when the rule should apply.
    3. "True Action" to define what happens when the trigger is met (or always, if Trigger is blank).
    4. (Optional) "False Action" to define what happens when the trigger is not met.
    5. (Optional) "Shortcut Keys" if you want a manual shortcut in review tools that support it.
  3. (Optional) Add child Data Rules under the rule to build a multi-step decision tree.

testing and troubleshooting

  • If you need to test a rule interactively during Review, you can run it from a field container using the Run Rule command:
    • Alt + R
  • If a rule does not appear in the list, verify:
    • The rule’s "Scope" is compatible with the selected container.
    • The rule is stored where it is accessible for the Content Type you are reviewing.
  • If a rule never runs:
    • Confirm "Trigger" is either blank or evaluates to True for the current instance.
    • Temporarily simplify "Trigger" to True to isolate expression issues.
  • If values change but errors do not clear:
    • Data Rules re-validate fields that now have values after the True Action runs. If an error remains, check the Data Field’s "Is Valid", "Required", "Min Confidence", and other validation settings.

Data Rule properties (overview)

The key Data Rule properties are:

  • "Scope"
  • "Trigger"
    • A Boolean expression. If blank, the rule always executes the True Action.
  • "True Action"
    • The Data Action that runs when the Trigger evaluates to True (or always, if Trigger is blank).
  • "False Action"
    • The Data Action that runs when the Trigger evaluates to False. This is only shown when "Trigger" is not blank.
  • "Required Elements" (obsolete)
    • A legacy way to enforce conditional required elements. Prefer the Require Value Data Action.
  • "Shortcut Keys"
    • Optional shortcut for use in the Data Viewer tab on the Review Page.

Data Actions

Data Actions are the building blocks used in "True Action" and "False Action". Actions can be combined and nested to create multi-step logic.

Below are the main Data Actions, in the order commonly presented.