> For the complete documentation index, see [llms.txt](https://docs.decisionrules.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decisionrules.io/doc/rules/decision-table/binding-to-model.md).

# Binding to Model

Binding Input and Output model to Decision Table in decision table designer.

After creating the [input and output models](/doc/rules/common-rule-features/input-and-output.md), you need to bind these models to your Decision Table. The binding determines which data fields are used in your rule logic.

**Basic Binding:**

* **Input Model** → Bound to **condition columns**.
* **Output Model** → Bound to **result columns**.

## **Understanding Model Binding**

### **What Can Be Bound**

You can select any **leaf field** from the input/output model as a condition or result variable.

{% hint style="warning" %}
You cannot select a parent/root field that contains children as a condition/result variable. Only leaf fields (fields with no children) can be bound.
{% endhint %}

### **Use Case Example**

Consider the following model structure:

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FIMy9a6lyxz2d1da6Ru8Y%2FScreenshot%202026-02-12%20at%2012.07.27.png?alt=media&amp;token=629375ef-70ea-4cb1-9749-62d3ec5057c7" alt="" width="563"><figcaption></figcaption></figure>

From this model structure, here's what can and cannot be bound to columns:

#### **Can be bound:**

**Input:**

* `delivery.distance.car`
* `delivery.distance.ship`
* `delivery.distance.plane`
* `delivery.tariff`
* `package.weight`
* `package.longestSide`

**Output:**

* `shippingCost`
* `deliveryMethod`
* `status`

#### **Cannot be bound:**

* `delivery` (has children: `distance`, `tariff`)
* `delivery.distance` (has children: `car`, `ship`, `plane`)
* `package` (has children: `weight`, `longestSide`)

### **Flexible Usage**

**You don't need to use every field as a column.** Model fields can be used in different ways:

* As column bindings (condition or result columns).
* In calculations and expressions without being bound to a column.
* Referenced multiple times in different columns or cells.

This flexibility applies to both input and output models.

## **How to Bind Models**

### **Binding Input Model to Condition Columns**

1. Navigate to the **Decision Table Model**.
2. Create new input field.
3. Navigate to the **Decision Table Designer**.
4. Create a new **condition column**.
5. In the column header dropdown, select the input field you want to bind.

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FvFoDh6dlQvw40pOrTgPH%2FScreen%20Recording%202026-02-12%20at%2012.32.27.gif?alt=media&amp;token=87c0e376-cc68-4369-9ea4-845b59441b6b" alt=""><figcaption></figcaption></figure>

### **Binding Calculation field to Condition Columns**

1. Navigate to the **Decision Table Designer**.
2. Create new **calculation column** (rename it for better readability)
3. Create a new **condition column**.
4. In the column header dropdown, select the calculation field you want to bind.

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FmzgyY6jKen5PVTXxGPJJ%2FScreen%20Recording%202026-02-12%20at%2012.52.32.gif?alt=media&amp;token=858e112c-ce95-453a-b05e-e4cb6a7f8b49" alt=""><figcaption></figcaption></figure>

### **Binding Output Model to Condition Columns**

1. Navigate to the **Decision Table Model**.
2. Create new output field.
3. Navigate to the **Decision Table Designer**.
4. Create a new **result column**.
5. In the column header dropdown, select the output field you want to bind.

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FWCGDiq6K2FgKJIJ1CVYT%2FScreen%20Recording%202026-02-12%20at%2012.36.41.gif?alt=media&amp;token=b1747108-1728-4f77-8225-f9180a4eb66a" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Condition columns can also be bound to [Rule variables](/doc/rules/common-rule-features/variables/rule-variables.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decisionrules.io/doc/rules/decision-table/binding-to-model.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
