# Binding to Model

### Setting Up Binding to the Input & Output Model

After creating the [input and output model](/doc/v1/decision-tables/input-and-output.md), you need to bind these models to the conditions and results in the Decision Table Designer:

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

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

{% hint style="warning" %}
Note that you cannot select a root that contains any child as a condition/result variable.
{% endhint %}

#### Example of binding (Input Model):

<pre class="language-javascript"><code class="lang-javascript"><strong>// JSON Editor
</strong><strong>
</strong><strong>{
</strong>  "delivery": {
    "distance": {
      "car": {},
      "ship": {},
      "plane": {}
    },
    "tariff": {}
  },
  "package": {
    "weight": {},
    "longestSide": {}
  }
}
</code></pre>

**Simple Editor:**

<figure><img src="/files/kEtdr7bKQX7QZ4vKNm9L" alt=""><figcaption></figcaption></figure>

From this Input Model, the following values can be selected as condition values:

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

### Binding Models to Conditions and Results

1. Navigate to the **Decision Table Designer** section.
2. To bind the **Input Model** to **Conditions**:

   * Create a new condition column.
   * Select the condition variable in the column header.

   To bind the **Output Model** to **Results**:

   * Create a new result column.
   * Select the result variable in the column header.

{% hint style="info" %}
It is also possible to bind the condition columns to[ rule variables](/doc/v1/other/rule-variables.md) or [calculation column variables](/doc/v1/decision-tables/decision-table-designer.md#select-column-value). More information is in [Table Designer](/doc/v1/decision-tables/decision-table-designer.md#select-value-from-input-model).
{% endhint %}

<figure><img src="/files/RJEu3rOIr05ze02ZjrDA" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.decisionrules.io/doc/v1/decision-tables/input-and-output/binding-to-model.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
