# Binding to Model

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

After creating the [input and output model](https://docs.decisionrules.io/doc/v1/decision-tables/input-and-output), 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="https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/odBevJ5QIJu1101IKyGv/simple%20editor.png" 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](https://docs.decisionrules.io/doc/v1/other/rule-variables) or [calculation column variables](https://docs.decisionrules.io/doc/v1/decision-table-designer#select-column-value). More information is in [Table Designer](https://docs.decisionrules.io/doc/v1/decision-table-designer#select-value-from-input-model).
{% endhint %}

<figure><img src="https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/CSm9g3bjIoWpnlBIjXGm/binding.gif" alt=""><figcaption></figcaption></figure>
