> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leapter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Decision Tables

> Express first-match business rules as a grid of inputs and outcomes — clearer and easier to review than a long chain of nested decisions.

A **decision table** captures a set of rules as a grid: a few input columns, one or more output columns, and one row per rule. When some inputs match a row, that row's outputs are produced. It is the natural way to express a lookup — "these inputs lead to this outcome" — where a long chain of [Decision](/elements/controlling-the-flow#decision) branches would hide the structure.

Because the rules sit in a table, the inputs, the outcomes, and the order they are checked are all visible at a glance — which makes a decision table much easier for a reviewer to read and verify than nested IF/ELSE logic.

## Where decision tables appear

A decision table is a type of element inside a Blueprint, shown as a grid with a table icon in the Blueprint's diagram — both in the [Specification view](/editor/specification-view) and in the [Diagram view](/editor/diagram-view).

<img src="https://mintcdn.com/leapter/7EqC4xHUro9F4teL/images/decision-table-maximized.png?fit=max&auto=format&n=7EqC4xHUro9F4teL&q=85&s=948530408f2e83fb030047adc452be8a" alt="A maximized decision table from the Loan Application Scorecard — Map risk category and credit history to a decision, with the input columns riskCategory and hasCleanCreditHistory, the output columns decision and reviewAction, five rules, and the row ruler open on rule 2" width="510" height="295" data-path="images/decision-table-maximized.png" />

## How to read a decision table

| Part | Meaning |
| :- | :- |
| **Input columns** | The values a rule looks at (left of the arrow marker) |
| **Output columns** | The values a matching rule produces (right of the arrow marker `→`) |
| **Rows** | One rule each, checked from top to bottom |
| **`any`** | A wildcard cell — this rule does not care about that input's value |
| **First-match** | The **first** row whose inputs all match wins; no later row is considered |

The **F** in the table's top-left corner stands for **first match** and is a reminder that order matters: rules are evaluated top to bottom, and evaluation stops at the first row that matches. A row full of `any` at the bottom is a common way to provide a catch-all default.

An input cell matches when the input **equals** the cell's value (for example a value of a [Choice Type](/editor/type-definitions#choice-type) or a boolean), or when the cell is **`any`**. Output cells are expressions, so an outcome can be a fixed value or a small calculation.

## Creating a decision table

The quickest way to add a decision table is to ask the **[Lab Agent](/editing/lab-agent)**. Describe the rule as a mapping — for example *"map the risk category and the credit history to a decision"* — and the agent builds the table for you. When a rule is a straightforward lookup, the agent prefers a decision table over a chain of decisions.

To add one yourself, click a connection point in the diagram and choose **Create a decision table** in the [element palette](/elements/controlling-the-flow).

## Editing a decision table

**Edit a cell** by clicking it and typing a new value, or switch it to or from **`any`**. You can do this directly in the diagram or on the maximized table.

To change the table's shape, **maximize** it: click its maximize icon to open the full-width view. Rulers above the columns and next to the rows hold the structural actions:

| Ruler | Actions |
| :- | :- |
| **Row** (next to each rule) | **Add rule above**, **Add rule below**, **Delete rule** |
| **Column** (above each condition or result) | **Add condition before** / **after**, **Add result before** / **after**, **Remove condition** / **Remove result** |

To rename a column, click its header and type the new name.

Edits go through the same save path as any other change, so they appear in the [Timeline](/track-changes/timeline), can be undone, and show up in review just like edits to any other element.

## Running a decision table

When you [run your Blueprint](/test-and-validate/test-your-blueprint), the row that fired lights up in the table, so you can see exactly which rule applied for a given set of inputs. This makes it easy to confirm that the right rule won — especially useful when several rows could plausibly match and first-match order decides between them.

## What to do next

* **[Controlling the Flow](/elements/controlling-the-flow)** — the other elements that make up a Blueprint
* **[Lab Agent](/editing/lab-agent)** — build and edit decision tables by describing the rules
* **[Test your Blueprint](/test-and-validate/test-your-blueprint)** — run your logic and see which row fires


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.