# Import Decision Table

## Importing a Rule

Importing a rule in DecisionRules can involve either:

* **Importing a new rule**
* **Importing a new version of an existing rule**

### Importing a New Rule

You can import a new rule through either the folder sidemenu or the **Rules** section of DecisionRules:

* **Folder sidemenu**: Right-click the folder where you want to import the rule (e.g., Home), and choose **Import**.
* **Rules section**: In the **Rules** section, click the **Import** button in the top-right corner.

<figure><img src="https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/0cSAaqzZzj18d4jWOnvT/Import%20rule.png" alt=""><figcaption><p>Import rule</p></figcaption></figure>

You will then be prompted to drag and drop or choose a file from your system that contains the rule.

* Drag and drop your rule file into the designated dashed area, or click within the area to open a file explorer.
* Supported formats for Decision Tables include **JSON** and **XLSX**.

<figure><img src="https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/Faik3MfgqjnObMlDCo1V/import%20moda;.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/kIb63cnt8adu0x3p3rGQ/imported%20rule.png" alt=""><figcaption></figcaption></figure>

Once your rule file is selected, click **Import**.

### Importing a New Version of an Existing Rule

To import a new version of an existing rule, you have three options:

* **Folder sidemenu**: Right-click the rule for which you want to import a new version, and choose **Import Version**.

<figure><img src="https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/R2nqUzRoc4SnwHkyOGKC/inport%20version%20folders.png" alt="" width="247"><figcaption></figcaption></figure>

* **Rules section**: Click the three dots in the bottom-right corner of the rule tile, and select **Import Version**.

<figure><img src="https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/Ji9YTuqbTPmIYnTWdgnn/import%20version%20rules.png" alt=""><figcaption></figcaption></figure>

* **Rule settings**: Click the **Import Version** button in the top-right corner.

<figure><img src="https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/oMg47KeQI3tvbOkO1WaR/import%20version%20rule%20sett.png" alt=""><figcaption></figcaption></figure>

After selecting your method, a prompt will allow you to choose between two options:

* **Import as new version**: The imported rule will be added as a separate version.
* **Overwrite current version**: The imported rule will replace the current version.

<figure><img src="https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/frJW7Zr9EP6Melr71131/import%20version%20overwr.png" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
Overwriting the latest version cannot be undone, and the replaced version will be permanently lost.
{% endhint %}

Once you've selected the import option, drag and drop your rule file into the designated area or click to open a file explorer. The supported formats are **JSON** and **XLSX** for Decision Tables.

<figure><img src="https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/5HcfHJtnBL1fBST90PfG/modal%20with%20imported%20rulke%20version.png" alt=""><figcaption></figcaption></figure>

After selecting the file, click **Import**.
