Business Rule Actions

Access. Business Rules is available to three roles. SuperAdmin can create and edit rules. ProcureToPay Manager and ProcureToPay Agent have read-only access. See the Roles and Access Reference.

Overview

An action sets one target field. Actions appear in the THEN clause, which runs when the conditions are met, and optionally in the ELSE clause, which runs when they are not.

The action types offered depend on the target field’s type. This article lists all four, their limits, and the syntax the two composed types use.


Action types

The action types you can choose depend on the target field, so not every type is available for every field.

Table 1. The four action types

Action What it does Offered for
Set to Sets the target field to a value you supply. Preselected for every target. All target field types
Copy from another field Copies the value from a source field on the same document. All target field types, subject to type compatibility
Calculate As Computes a number with an arithmetic formula. Amount target fields only
Set Blank Clears the target field. Takes no value. All target field types

The amount targets (Total Amount, Net Amount, Total Tax, Price, and Amount) offer all four. Every other target offers three, with Calculate As absent.

The action list for an amount target, showing Set to, Copy from another field, Calculate As, and Set Blank.

Figure 1. The action list for an amount target.

A target field can appear only once across the THEN actions. To set the same field two ways, use conditions to separate the cases into two rules.


Set to

Set to writes a fixed value. For a dropdown target, you select from that dropdown’s values; for a date, number, or amount target, you enter a value of that type.

Composed text values

For text targets such as a memo or description field, a value can mix static text with references to other fields on the document. Type @ to insert a reference, then pick the field from the list. The reference appears as a chip in the editor rather than as raw text. Fields are grouped so header and line fields are distinguishable.

At run time each chip is replaced with that field’s value from the document being processed.

Table 2. A composed value

Stage Value
Entered PO-@{PO Number} received from @{Vendor Name} on @{Date}
Written to the field PO-4500012345 received from Northwind Supplies on 2026-07-15

Copy from another field

Copy from another field takes the value from a source field on the same document. The source list is grouped into header and line fields.

Source and target have to be type-compatible:

Table 3. Which source types a target accepts

Target field type Compatible source types
Text Any field type
Date Date fields only
Amount Amount fields only
Number Number fields only
Boolean Boolean fields only
Dropdown Fields built on the same dimension, such as Cost Center to Cost Center, or Spend Category to Spend Category

The source list is filtered to match the target. Every action draws on the same master list of fields, and choosing a target narrows that list to the fields the target accepts. An incompatible pair therefore cannot be built in the first place, rather than being refused later. Text targets such as Description and Memo are the exception, and accept any source, because they hold free text and any value can be rendered as text.

An empty source list means the document carries nothing compatible. Dropdown targets are the usual case: the list offers only fields built on the same dimension, so where the document has no second field of that dimension the list appears empty. That is a type mismatch rather than a fault.

A worked example: a rule that reads IF Currency Exists, THEN Vendor Bill Ext ID Copy from another field Currency is valid, because Vendor Bill Ext ID is a text field and accepts a dropdown source. Reversing it would not be offered at all, because a dropdown target lists only fields built on the same dimension.


Calculate As

Calculate As computes a numeric value. It is offered for amount target fields only.

Formulas support addition, subtraction, multiplication, division, and parentheses. Field references are inserted with @, exactly as in Set to. Selecting Calculate As replaces the value box with a formula box, which carries the hint:

Use @ to insert a field, or type numbers and operators

Expressions follow standard arithmetic precedence: parentheses first, then multiplication and division, then addition and subtraction, each left to right. Use parentheses wherever you want the order to be beyond doubt.

A Calculate As action computing Total Amount minus Total Tax, with each field reference shown as a chip.

Figure 2. A Calculate As action. Each field reference appears as a chip rather than as typed text.

Table 4. Formula examples

Formula Computes
@{Quantity} * @{Price} A line total from quantity and price.
@{Total Amount} - @{Total Tax} - @{Freight Amount} A net amount with tax and freight removed.
(@{Total Amount} - @{Total Tax}) / @{Quantity} A unit figure, with the subtraction forced first.

Formula validation

A formula is checked as you build it, and an invalid formula blocks the save.

Table 5. Formula validation messages

Message Cause
Formula is required The formula is empty.
Unknown field(s) A referenced field is not available on this record type.
Formula contains invalid characters Only digits, decimal points, the four operators, parentheses, and spaces are accepted.
Unmatched opening parenthesis A ( has no closing partner.
Unmatched closing parenthesis A ) has no opening partner.
Invalid operator sequence Two operators sit together, as in 1 +* 2. A leading minus for a negative number is accepted.
Division by zero detected The expression divides by a literal zero.
Invalid formula syntax The expression is not a well-formed arithmetic expression.

Each message appears as you type, before any attempt to save.

A formula dividing by a literal zero is caught as you type, so it never reaches processing. A formula dividing by a field that turns out to be zero on a particular document is a different matter, and nothing in the editor can see that.

At run time, a formula needs every field it references to hold a number. Where a referenced field is empty on a document, or holds something that is not a number, the rule does not run for that document. The missing value is not treated as zero, and no partial result is written.

That makes field choice part of designing the formula. A formula built on fields that are populated on every invoice runs every time; one built on an optional field quietly skips the documents where that field is blank. Where a field is not always present, add a condition that it Exists so the rule states its own dependency.


Set Blank

Set Blank clears the target field and takes no value.

It is the one action that interacts with the condition-action conflict check differently: a field tested with Is Blank in the IF clause may also be a Set Blank target in the same rule. See Business Rule Validation and Field Warnings.


Fields that cannot be set

The field picker in the THEN clause offers fewer fields than the one in the IF clause. Some fields can be tested in a condition but never set by an action.

These fields appear in the condition picker but not in the action picker:

  • Vendor Name
  • Bot Confidence Level
  • Invoice Received Date
  • Freight Amount

Most are values the platform derives or receives rather than ones you would code: a rule can branch on the supplier, but it cannot rewrite which supplier sent the invoice.


Line field actions

An action on a line-level field can carry a scope, offering Same Line or All Lines, with Same Line preselected.

Table 6. Line action scope

Scope Applies to
Same Line Only the lines that matched the condition.
All Lines Every line on the document.

The scope control appears only when the rule also has a line-level condition. A line-level target on a rule whose conditions are all header-level, or which uses Apply to all documents, shows no scope control. No matched line exists for Same Line to refer to, so the action applies across the lines.

When you read an existing rule, treat the absence of a scope control as information rather than as an omission.


ELSE actions

The ELSE clause holds actions for documents where the conditions are not met. It is added with + Add else, uses the same four action types and the same rules, and is optional.

A rule with Apply to all documents selected has no conditions to fail, so it has no ELSE branch.


Results

You can set a target field using any of the four action types, and you know which fields no action can set.


Related information