Create and Manage Business Rules

Access. Business Rules is available to three roles. SuperAdmin can create, edit, copy, reorder, delete, and switch rules on and off. ProcureToPay Manager and ProcureToPay Agent have read-only access. See the Roles and Access Reference.

Overview

This article covers a rule's whole life: reading the list, building one from an empty form, and then reordering, copying, disabling, deleting, and exporting the set.

Rules live in SmartVendor Settings, on the Business Rules tab, and they run one after another in a sequence you control. Order matters whenever one rule depends on what another wrote. Where rules are independent, the sequence has no effect on the result.


Before you start

  • Settle field extraction first. A rule can only test and set fields the agent is configured to extract. Building rules before extraction is settled means reworking them.
  • Know which fields sit at header and which at line level. The field picker groups them, and the grouping is set by your ERP and field configuration rather than being the same everywhere.
  • Decide whether the rule needs conditions at all. A rule that should apply to every document uses Apply to all documents instead of an IF clause.
  • Check what already exists. A rule that repeats an existing rule's conditions and target fields does not save. A rule that targets the same field under different conditions does save, and then both run. Reading the list first tells you which of the two you are about to build.
  • Know which rules depend on each other. A rule that reads a field another rule sets has to run second. Reordering a set with dependencies without knowing them is how a working configuration quietly breaks.
  • Disabling changes the numbers. The sequence closes up when a rule leaves it, so the numbers on other rules shift.

Getting to Business Rules

Business rules live in SmartVendor Settings, against a single Agent Co-worker. The page always shows the rules for the agent named in the header, so the first thing to check when a rule is missing is which agent is selected.

  1. In the left navigation, point to the SmartVendor icon, then select Settings.
  2. Select the Business Rules tab.

The header names the agent and its state, for example Active, with an arrow beside the name for switching to another agent. Below the header sit two tabs, Business Rules and AP Intelligence, and Business Rules opens by default.

Which fields a rule can use is decided by the system the agent is connected to, so two agents on different systems do not offer the same field list.

The read-only view in the agent wizard

Business rules also appear inside the Agent Co-worker wizard, on the Define capabilities step. Open Agent Co-workers, edit the agent, go to Define capabilities, then choose Business rules in the left rail, under the AP Invoices tab.

That view lists every rule configured for the agent but cannot change any of them. It carries a note at the top:

NOTE: This page shows all the business rules configured for this Agent. To add a new rule or update existing rules, go to SmartVendor Settings.

The link in that note takes you to the editable page. Where no rules exist yet, the list reads No business rules available.

The two views differ in one small way: the wizard labels the timestamp column Last Updated At, while SmartVendor Settings labels the same column Last Updated On.


The rule list

The toolbar

Four controls sit above the table, from left to right.

Table 1. Controls above the rule list

Control What it does
+ Add Rule Opens the New rule panel. Unavailable while a rule is already open for editing.
Search box Filters the list as you type.
Filter Tooltipped Filter Records. Opens a row of per-column filters above the list. See Filter the list by column below.
Export Downloads every rule as a CSV file. See Export the rule set below.

Below the toolbar sits the Show: control, described in Filter the list by status.

Reading the rule list

The heading reads Active rules followed by the number of enabled rules. It stays the same whichever view you select, so read the counts on the Show: control to see how many rules are in each state.

The Business Rules list, showing the Show filter, the rule columns, and the row controls.

Figure 1. The Business Rules list.

Table 2. Rule list columns

Column Holds
(check box) Selects the rule for a bulk enable or disable.
Rule The rule name. Select it to open the rule.
Rule Description The description, where one was entered.
Type How the rule is classified. See below.
Target Field The fields the rule writes to, each tagged Header or Line.
Last Updated By Who last changed the rule.
Last Updated On When they changed it.
Order of Execution The rule's position in the sequence. The list is sorted on this column by default, ascending.

Reading a row

Each row carries controls at both ends. At the start: a drag handle, tooltipped Drag to reorder, and a check box for selecting the rule. At the end: an enable and disable toggle, then two controls tooltipped Copy Rule and Delete rule.

The foot of the table carries Rows per page, set to 20 by default, a count in the form 1-3 of 3, and first, previous, next, and last page controls.

The Type column

Type describes the shape of the rule rather than what it targets, and it is derived from how the rule is built rather than set by you.

Table 3. What the Type column shows

Rule as built Type shows
Any rule with an IF clause Conditional
A rule using Apply to all documents Conditional, with an Applies to all badge beside it

A rule whose condition is line-level still reads as Conditional; the level shows in the Target Field column instead, as a Header or Line tag.

Filter the list by status

The Show: control has three options, each showing a count.

Table 4. List filters

Option Shows Reordering
Enabled Rules that currently run, in execution order. Available. Each row carries a drag handle.
Disabled Rules that are switched off, with -- for priority. Not available. A rule outside the sequence has no position to move.
All Both, in one list. Not available. Switch to Enabled to reorder.

Filter the list by column

The filter control opens a row of filters directly above the table, one under each column heading. Each filter has an operator and a value box, so you can narrow the list by more than one column at once. Selecting the control again hides the row, and a Clear All Filters control appears once a filter is applied.

Table 5. Column filters

Column Operator Value
Rule contains Text to match in the rule name.
Rule Description contains Text to match in the description.
Type in The rule type.
Target Field in The field the rule writes to.
Last Updated By in The person who last changed the rule.
Last Updated On on or after A date, entered as MM/DD/YYYY or chosen from the date picker.
Order of Execution less than, equals, or greater than A position in the sequence.

Filtering by Target Field is the quickest way to find rules competing for the same field, and filtering by Last Updated On shows what changed recently. Both are worth reaching for before a rule set review.

The column filters work alongside the Show: status filter rather than replacing it. A column filter narrows whichever set Show: has selected.


Create a rule

Selecting + Add Rule opens a panel headed New rule, holding the name, description, and Order Of Execution fields, then an IF (Conditions) section and a THEN (Actions) section.

The New rule panel, with the IF (Conditions) and THEN (Actions) sections.

Figure 2. The New rule panel.

  1. On the Business Rules tab, select + Add Rule.
  2. Enter a Rule Name. This is the only required field, and it is what the rule list shows, so name the rule after what it does.
  3. Optional: Enter a Description. Use it for the reason behind the rule, because the conditions already say what it does.
  4. If the rule applies to every document, select Apply to all documents, then skip to step 6.
  5. Build the IF (Conditions) clause:
    1. In Select field, select the field to test.
    2. Select an operator.
    3. Enter or select the value.
    4. If the field is line-level, select Any Line or All Lines.
    5. To add another condition, select + Add condition.
  6. Build the THEN (Actions) clause:
    1. Select the target field.
    2. Select an action.
    3. Enter or select the value.
    4. If both the target field and a condition are line-level, select Same Line or All Lines.
    5. To add another action, select + Add action.
  7. Optional: Select + Add else, then build the actions for documents where the conditions are not met.
  8. If this rule has to run before an existing one, change Order Of Execution.
  9. Select Save.

The steps above stay deliberately short. The table below explains what each choice in the form decides, so you can build the rule first and read the reasoning when a control does not behave as you expected.

Table 6. What each choice in the form decides

Choice What to know
Apply to all documents Selecting it replaces the IF section with the note This rule applies to all documents regardless of field values, so there are no conditions to build.
Condition field Fields are grouped under Header Fields and Line Fields. The grouping matters when the same field name exists at both levels. A field already used in one condition is unavailable in the other condition rows.
Condition operator The field decides which operators are offered and which one is preselected. See Business Rule Conditions and Operators.
Condition scope Any Line is preselected, so the looser option is the default. Choose All Lines deliberately.
More conditions Conditions combine with AND, so every one has to be true.
Action Set to is preselected. The alternatives are Copy from another field, Set Blank, and, for amount targets only, Calculate As.
Action scope The control appears only when the target field and a condition are both line-level. Same Line is preselected.
More actions A target field can appear only once across the THEN actions, and is unavailable in the picker for any further action row.
Order Of Execution Prefilled with the next available number, which is correct unless this rule has to run before an existing one.

Save stays unavailable until the rule is complete, so a dimmed button means a required field or an incomplete condition rather than a permission problem. Conflict checks run as you build, not only when you select Save. Where one fires, a banner appears and Save stays unavailable. See Business Rule Validation and Field Warnings.

Cancel discards the rule without saving.

Once saved, the rule appears in the list with each target field marked Header or Line.

Rule names must be unique

Two rules cannot share a name. Entering a name already in use shows:

A rule with this name already exists

and Save stays unavailable until the name is changed.


A worked example

The requirement: invoices from three facilities suppliers should be coded to the Facilities department at the head office location, without anyone typing it.

Table 7. The rule, field by field

Field in the form Value entered
Rule Name Facilities suppliers. Default department and location
Description Agreed with the Facilities team, June 2026. Applies to the three contracted suppliers only.
Apply to all documents Cleared. This rule is supplier-specific
IF condition 1 Vendor Name · In · Northwind Supplies, Contoso Facilities, Fabrikam Logistics
THEN action 1 Department (Header) · Set to · Facilities
THEN action 2 Location (Header) · Set to · HQ
ELSE None
Order Of Execution 4

Read back, the rule says: if the supplier is one of those three, set Department to Facilities and Location to HQ.

This example demonstrates two things. In with three values does the work of three separate rules, and because both target fields are header-level, no scope control appears. Vendor Name also does not offer Equals, so to match a single supplier, use In with one value.

The same requirement with a second condition

Now suppose one legal entity codes those suppliers differently. Conditions are AND-only, so the obvious move is a second, narrower rule:

Table 8. A narrower rule for one entity

Field in the form Value entered
Rule Name Facilities suppliers. EU entity override
IF condition 1 Vendor Name · In · the three suppliers
IF condition 2 Entity · Equals · EU Operations
THEN action 1 Department (Header) · Set to · Facilities EU
Order Of Execution 3

That pair saves, and that is the catch. Validation refuses only a rule that repeats an existing rule's conditions and target fields; this one adds a condition, so nothing stops it. What it leaves behind is two rules that both set Department on an EU invoice from those suppliers, with Order Of Execution alone deciding which value survives. Nothing on the page flags it.

The build that does not depend on ordering is a single rule with a THEN and an ELSE:

Table 9. Both cases in one rule

Field in the form Value entered
IF condition 1 Vendor Name · In · the three suppliers
IF condition 2 Entity · Equals · EU Operations
THEN action 1 Department (Header) · Set to · Facilities EU
ELSE action 1 Department (Header) · Set to · Facilities

One rule, one outcome per document, and the two cases sit next to each other where the next reader finds them.

A line-level example

The requirement: apply a coding value to the lines that matched a line-level condition.

Table 10. A rule that writes to lines

Field in the form Value entered
Rule Name Freight lines to freight cost center
IF condition 1 Description (Line) · Contains · freight · Any Line
THEN action 1 Cost Center (Line) · Set to · 1400 · Same Line
Order Of Execution 7

Both halves are line-level here, so the scope control appears on the action. Same Line confines the change to the lines that matched; All Lines would code every line on the invoice to 1400, which is rarely the intent.

A rule with a line-level condition and a line-level action, showing the Any Line scope on the condition and the Same Line scope on the action.

Figure 3. Scope controls on a line-level rule. Save and + Add action stay unavailable until the action has a value.


Variations

Copy a rule

Copying is the quickest way to build a rule that differs from an existing one in only a value or two.

  1. Find the rule in the list and select Copy Rule on its row. The same control is available inside an open rule.
  2. The New rule panel opens with every condition and action copied across, and the name prefilled as Copy of followed by the original name.
  3. Change the name. Two rules cannot share a name, so the copy does not save until you do.
  4. Adjust the conditions, actions, and Order Of Execution, then select Save.

A straight copy is a duplicate of the original, so the panel opens with the duplicate banner already showing and Save unavailable. Changing a condition clears it. Nothing is written until you save, and Cancel discards the copy and leaves the original untouched.

Rules that read what another rule wrote

A rule can test a field an earlier rule set, as long as the earlier rule carries the lower Order Of Execution. Build the writing rule first and give it the lower number.

For example, rule 1 sets a custom flag field where PO Number Exists; rule 2 then tests that flag and sets an approval routing field. Rule 1 has to be the lower number, or rule 2 tests an empty field.

Order Of Execution decides the outcome. Each rule runs once, in ascending Order Of Execution, so a rule reads the values that the rules before it have already written. Where two rules each read a field the other writes, the sequence settles which value stands. Set the numbers deliberately rather than relying on the order the rules happen to have.

Editing a rule that is switched off

A disabled rule opens read-only. To change one, re-enable it first, make the change, then disable it again if you are not ready for it to run. Re-enabling also moves it to the end of the sequence, so reset Order Of Execution if its position mattered.

Handling an either/or

Conditions are AND-only. To act on either of two situations, build one rule using ELSE, or two rules whose conditions cannot both be true. The ELSE build is the safer of the two, because two rules that can both apply to one invoice leave the outcome to Order Of Execution.


How the sequence works

Rules run in ascending Order of Execution: 1, then 2, and so on. Only enabled rules take part.

  • A new rule defaults to the next available number, placing it at the end. On a tenant with one enabled rule, a new rule opens with 2 already filled in.
  • A disabled rule leaves the sequence entirely, and its priority displays as --. The remaining rules close the gap.
  • A re-enabled rule is appended after every currently enabled rule. Its previous position is not restored.

Switching a rule off and on again is not a neutral act: it moves the rule to the end of the sequence. If its position mattered, set Order Of Execution again afterwards.

Reorder rules

  1. Select Enabled in the Show: control. Reordering by dragging is available on this view, because only enabled rules have positions.
  2. Drag a rule by the handle at the start of its row to the new position. The numbers of the rules it passes adjust to suit.

To move a rule to a specific number instead of dragging it:

  1. Open the rule.
  2. Change Order Of Execution.
  3. Select Save.

The field is blank and locked for a disabled rule, and on the Disabled view, because a rule outside the sequence has no position to set.


Switch a rule on or off

Each row carries a toggle.

A disabled rule keeps its name, description, conditions, and actions, and does not run. Nothing is lost by switching a rule off, which makes it the safe way to take a rule out of service while you decide whether to remove it.

To change several at once, select them with the row check boxes and apply the change to the selection.

A disabled rule opens read-only. To edit one, enable it, make the change, then disable it again if it is not yet meant to run, remembering that re-enabling moved it to the end of the sequence.


Delete a rule

Deleting removes a rule outright. Where you only want it to stop running, disable it instead: a disabled rule keeps its whole definition and can be switched back on, while a deleted one has to be rebuilt from scratch.

  1. Find the rule in the list and select Delete rule on its row.
  2. A Confirm Delete dialog appears, reading:

    Are you sure you want to delete this rule? This action cannot be undone.

  3. Select Delete to remove the rule, or Cancel to keep it.

The Confirm Delete dialog, asking whether to delete the rule, with Cancel and Delete buttons.

Figure 4. The Confirm Delete dialog.

The dialog is the only safeguard. A deleted rule cannot be recovered, so read the rule name in the row before you confirm.

Deleting a rule closes the gap in the sequence, so the Order Of Execution numbers of the rules below it shift up.


Export the rule set

The export control above the table downloads the rule set as a CSV file.

The export is structured one row per condition and one row per action, so a rule with two conditions and three actions occupies five rows sharing a rule ID.

Table 11. Columns in the exported file

Column Holds
Rule ID The rule's identifier. Rows sharing this value belong to one rule.
Rule Name The rule's name.
Rule Description The rule's description, where one was entered.
Status Whether the rule is enabled or disabled. Reads Active for an enabled rule.
Order of Execution The rule's position in the sequence.
Row Type Whether this row carries a condition or an action.
IF Field The field tested, on condition rows.
IF Operator The operator used.
IF Value The value compared against.
THEN Field The target field, on action rows.
THEN Operator The action type.
THEN Value The value, formula, or source field applied.
Last Updated By Who last changed the rule.
Last Updated On When they changed it.

Because the whole set arrives as a table, a spreadsheet is the practical way to review a large rule set. Sort by target field to find rules competing for the same field, or by Last Updated On to see what changed recently.


Troubleshooting

Most snags while building a rule are the form enforcing its own logic. Match what you see to what it means.

Table 12. Problems while building a rule

What you see What it means
Save is dimmed The rule is incomplete. Usually a missing Rule Name or an unfinished condition. It is not a permission problem.
The operator you want is not in the list Operators are filtered by the field's data type. Date fields offer only Is Within and Is Beyond, and Vendor Name offers no Equals.
Calculate As is not offered The target field is not an amount field. Formulas are available for amount targets only.
No Same Line / All Lines control appears The rule has no line-level condition, so there is no matched line to scope to.
The field you want is unavailable in the picker It is already used, either in another condition of this rule or as another action's target.
The save is rejected for a conflict with the IF clause A field used in the IF clause is also a THEN target. See the exceptions in Business Rule Validation and Field Warnings.
The save is rejected as a duplicate An enabled rule already has the same conditions and the same target fields. Change a condition, target a different field, or edit that rule instead of adding a second one.
The rule saved but the form is read-only when reopened The rule is disabled. Re-enable it to edit.
The rule saved and runs, but the field is unchanged Something may be overriding the rule. See the priority order in What Are Business Rules?.

Results

You have a rule built from an empty form, with its conditions, THEN actions, and any ELSE actions set; you can read the list, place the rule in the sequence, and copy, disable, delete, or export it.


Related information