Field Sources and Rules

Who this is for. SmartCustomer users with the SuperAdmin role.

Availability. The AR Mapping tab appears in SmartCustomer when AR Mapping is enabled for your organization.


Overview

On the Field mapping step, each master field takes its value from a source. The sources on offer depend on the kind of field. Header fields take one value per document, read from the block above the table. Line item fields take a column. Fields you set to come from the email read the email instead of the file.

Rules compute a value or fix one, and any field can use a rule as its source. This article lists the sources and describes how rules work.

Selecting a field on Header fields or Line item fields opens its panel. The panel shows the field's sources and its current value in LIVE PREVIEW. A mapped field also shows Clear, which removes its mapping.

The Payment Date field with Metadata key selected, five key and value pairs found above the table, and a live preview of the date

Figure 1. A header field read from a key and value above the table


Header field sources

A header field takes one value per document. Its panel reads header field · one per document.

Table 1. Header field sources

Source What the field reads
Metadata key A key and value pair found above the table, such as Payment Date: 2026-09-15 00:00:00. Selecting a pair maps the field to it.
Sheet cell One cell in the area above the table. Choosing this source shows a grid of that area. Selecting a cell maps the field to it. The field then shows the cell's value, for example Sheet cell · CHQ-104522. The panel names the cell, for example Using B5 — “CHQ-104522”.
Detect currency Currency fields only. A currency code or symbol found in the file, for example USD or $.
Constant The same value for every file, typed in Constant value, for example USD.
Rule The result of a rule. See Rules on this page.

Transaction Reference read from cell B5 of the area above the table, with the grid of that area and a live preview of CHQ-104522

Figure 2. A header field read from one cell above the table

Selecting Constant maps the field straight away, before you type a value. The field then shows Constant · “”. If you do not want a constant, Clear removes it.

Detect currency scans each file again, so each remittance gets its own currency. When the file states a currency, the field shows Currency · detected from the file, and the preview shows the currency. On a file that states a currency, the first pass can set the currency fields this way. If a file has no currency code or symbol, the field shows No currency code/symbol found in this file. That error blocks activation until you choose another source or clear the field. If the first pass set the field, a sample with no currency fails the test instead. The reason beside Activate then names or counts the samples with errors.

For example, the Northwind Traders sample states no currency. With Detect currency, Payment Currency shows Error, and Activate shows Resolve 1 field error before activating. Setting it to Constant with the value USD clears the error.

Payment Currency in error with Detect currency selected, and the message that the file has no currency code or symbol

Figure 3. A currency field when the file states no currency


Line item field sources

A line item field takes a value for each row of the table. Its panel reads line item field · per row.

Table 2. Line item field sources

Source What the field reads
Field → Field One column of the table. Selecting a column chip, or a column header in the source table, maps the field to it. The field then shows the column, for example Sheet column · Invoice Number.
Composite Two or more columns joined into one value. Not offered for number fields.
Rule The result of a rule, for each row.

When a sample workbook has more than one sheet, the panel also offers From sheet. It lists each sheet, for example Remittance (this sheet) and Credit Notes. Choosing a sheet lists that sheet's columns as chips. Selecting a chip then reads that column in row order. Its first row goes to the first line, and its second row to the second line. Lines past the sheet's last row read nothing. The rows are not matched by any value. After you save the mapping and open it again, From sheet is not offered. The other fields can then read that sheet too. For the steps and the caution, see Read a column from another sheet in Review the field mappings.

In Composite, the columns join in the order you select them. Selecting a column again removes it. The Join separator has four options:

  • space
  • comma
  • dash
  • none

For example, Joined · Invoice Number + Status with a space gives values such as INV-10001 PAID.

Reference Number joined from Invoice Number and Status with a space, and a live preview of values such as INV-10001 PAID

Figure 4. A line item field that joins two columns


Fields read from the email

A header field set to Email on Master fields reads the email's subject or body. Its panel reads header field · from the email.

Table 3. Email field sources

Source What the field reads
Email extraction A value found in the email samples. Selecting one of the values listed maps the field to it.
Rule The result of a rule.

After you select a value, the field shows where the value sits, for example Email body · after “Payment reference: EFT”. For a value the list missed, + Add opens Add from the email, where you highlight the value. For the steps, see Add a value the list missed in Review the field mappings. The text before the value tells the mapping where to find it in future emails.

The Email samples panel beside the field shows each email sample. The chosen value is marked in the subject and the body. The first pass and Auto-map can leave an email field Not mapped.

Payment Number read from the email, with Email extraction selected, the values found in the email samples, and a live preview of 0048213

Figure 5. A header field read from the email body

The Email samples panel with the Northwind Traders email, and the value 0048213 marked in the subject and the body

Figure 6. The email sample with the chosen value marked


Rules

Rules live on the Rules tab of Field mapping. The count on the tab is the number of rules that are on.

Table 4. Kinds of rules

Kind What it is How it is added
From formulas A calculation taken from the customer's own Excel formulas, such as a line amount or a statement total Detected when you confirm the table boundaries, or added with New rule and From Excel formulas
Plain English A value fix you describe in words, such as if currency is empty, use USD Added with New rule and Plain English, then Build with AI. When the rule reads a column, that column is already chosen, and you can change it.

After Build with AI, WHAT IT WILL DO lists the steps of the rule, such as default = TODAY. Save rule adds it to Rules. For the steps, see Write a rule in plain English in Add and manage rules. A plain-English rule can use a condition, such as only the lines where Status is PAID. It can also use today's date.

If Build with AI cannot build the rule, a message replaces WHAT IT WILL DO. One message is AI did not produce any applicable operations from that description. Another starts AI output did not match the general-rule schema. A reworded description can build, and the same description can also build on another try.

A rule you write that repeats a detected rule is added as a second rule.

Each rule appears as a card. The following table describes what a card shows.

Table 5. Parts of a rule card

Part What it shows
Scope row runs the rule on each line. table runs it once per table, for example a table subtotal. document runs it once for the whole file. A plain-English rule shows English in its place.
Description What the rule does, in words, for example Amount Paid is Invoice Amount minus Discount for each line.
Binding The field that uses the rule, for example Binds to Total Amount. One rule can bind to several fields, for example Binds to Total Amount, Statement Number / Batch Number. Otherwise, Not bound yet — bind it to a field in Field mapping to use it. An unbound plain-English rule reads, for example, Applies to Invoice Number by default — bind it to a field in Field mapping to use it there.
Switch Turns the rule on or off
Edit and delete icons Open the rule to change it, or delete it. Deleting takes one select, with no confirmation. For the steps, see Add and manage rules.

The Rules tab with no shared rules and four Northwind Traders rules, two bound to fields and two not bound yet

Figure 7. Rules for one customer on the Rules tab

Shared and customer-only rules

The tab groups rules in two lists. Shared rules apply to all customers. This customer only holds the rules of this mapping. Another mapping for the same customer does not list them. The Apply to all customers switch in the rule editor shares a rule with all customers.

Rule binding

A formula rule does nothing until a field uses it. A field uses a rule through its Rule source. The rule's card then names the field it binds to. For the steps, see Bind a rule to a field in Add and manage rules.

A plain-English rule that rewrites a value reads one column. When you bind it, the column it reads is already chosen under Value this rule transforms, for example Remarks. The list offers the table's other columns too. The panel prompts for it, for example “Invoice number from Remarks” rewrites a value — choose the column it reads.

In a field's Rule source, Predict rule with AI offers to detect the calculation from the sheet's totals. Its tooltip reads Detect the calculation for this field from the sheet's totals, even without an Excel formula. It can choose the wrong total. See Known limitations in AR remittance mapping messages.

Switched-off rules

Switching off a rule that a field uses gives that field the error Rule is disabled. The error blocks activation, and it clears the test result. You can still save the mapping as a draft. A switched-off rule also leaves the list in a field's Rule source.

Changing a rule, switching it off, or deleting it lasts only if you save the mapping. A rule you add is kept at once.

Review notes

When you open a rule, it shows the formulas it came from. It also shows any review notes, for example Detected by AI — review before activating. A note also appears when the rule does not reproduce a value in the file. Other notes say what the mapping corrected, such as Auto-corrected: the first generalization didn't reproduce the file's own value; this one does. After Improve with AI, the note reads Generated by AI — review before activating.


Related information