# Configure related tables (optional)

### Why do I need related tables?

The rule engine can check conditions not only on the primary table, but also on **related tables** (e.g. header/lines).

You define these related tables in the template in the area:

<div id="bkmrk-zugeh%C3%B6rige-tabellen-"><div>- **Related Tables** (technically: "DXP Rule Set Tables")

</div></div>### Add a related table

<div id="bkmrk-in-der-vorlage-im-ab">1. In the template, in the section, **Related Tables** create a new line.
2. **Table ID** select (lookup).
3. Define the relation to the primary table: 
    - <div><div>**Relation Field 1** (field number in the related table)</div></div>
    - **Primary Field 1** (field number in the primary table)
    - <div><div>Optionally also **Relation Field 2 / Primary Field 2** etc.</div></div>

</div>Rule of thumb:

<div id="bkmrk-beziehungsfeld%28er%29-%3D">- <div><div>Relation field(s) = "foreign key" in the related table</div></div>
- <div><div>Primary field(s) = the matching key/reference fields in the primary table</div></div>

</div>[![image-1770031936324.png](https://docs.squeeze.one/uploads/images/gallery/2026-02/scaled-1680-/image-1770031936324.png)](https://docs.squeeze.one/uploads/images/gallery/2026-02/image-1770031936324.png)

**Important:** Without a correctly defined relation, the rule engine cannot cleanly evaluate fields of the related table against the current record.