# Rule items

> Create, edit, delete and copy rules in the Rules manager.

[Rules](rules.md) > [Rules manager](rules_manager.md) > Rule items

Rules are statements configured to automatically execute a procedure triggered by a certain condition. Basically, rules consist of two parts: criteria and actions. _Criteria_ are conditions that must be met in order to trigger an action (e.g., a criterion can be that the numeric value of a field is within a specified range). _Actions_ are operations to be performed on a target element (e.g., changing the value stored in a field). In other words, it’s an "If-Then" (if this happens, then do that) statement.

The rules are shown as a list in the **Rules** section of the Rules manager. Click on a specific group to display just its rules.

## Create a rule

1.  Click on the `+` (New rule) button and type a **Name** on the **Edit** section that was just displayed. Optionally, add a **Description** where you can explain what the rule is for.

2.  Choose a **Trigger** and **Target table**.

    -   The **Trigger table** is the table to which the criteria of the rule will apply.

        > **Note:**
        > 
        > For cases where you wish to trigger the rule without criteria, then choose **No trigger**, but be aware that a type of rule like this must be called by the trigger IQL function.

    -   The **Target table** is the table on which the action of the rule will be executed.

    > **Tip:**
    > 
    > When using **Run iql**, It is recommended to set the **target table** to the same table as the **trigger table**. Executions in other tables is done with operations in [run iql](iql_in_rules.md).

3.  Other options

    -   Optionally, keep the **Only trigger once** box checked in order to prevent rules from being triggered multiple times on the same record upon save action. This is useful in case the rule turns out to be [recursive](examples_of_rules.md#recursive).

        > **Note:**
        > 
        > Note that this setting cannot be combined with scheduled rules.

    -   The checkbox called **Use old relation value to identify target record** is available only if the current record has a reverse relation to another table. If ticked, the rule targets the record pointed to by the Relation _before_ the change that triggered the rule. If the checkbox is not ticked, the rule targets the record pointed to by the Relation _after_ the change that triggered the rule.

    -   The **Active** checkbox refers that the system will evaluate the content of the item.

        > **Tip:**
        > 
        > Use the **More actions…​** button to activate or deactivate multiple rules selected at once.

4.  Choose **Trigger conditions**, i.e. the criteria that will activate the rule. Read more [here](set_criteria.md).

    -   Add more criteria by using the buttons **AND** and **OR**, which indicate logical-and and logical-or, respectively. The **AND** operator has the precedence over the **OR** operator, and is executed first. In the box that displays the trigger condition being assembled (in the lower portion of the form), this is expressed by lines beginning with an **OR** operator being indented.

        > **Note:**
        > 
        > It is important to note that the criteria will only be evaluated if there are changes in the fields included (or changes in the record in question, in case **Record keyword** is chosen). In other words, a rule will not be considered unless _at least one of the items (field/record) in the criteria is used_ when creating or saving a record on [application forms](application_forms.md#action_icons), or editing via [imports](import_templates.md).
        > 
        > This is, in order to perform the [**rule action**](set_actions.md), the criteria need to be evaluated first and return True (i.e., fulfill the required value or state).
        > 
        > See complete [examples of rules](examples_of_rules.md).

5.  Once the criteria is set, click on the **Add** button below and set an actions.

6.  Save.

> **Tip:**
> 
> Pay attention to the **Warnings** column of the **Rules** section as it may offer detailed information regarding issues encountered while running the rules.

## Edit a rule

Select the desired rule and click the **Edit** button. Save the changes.

## Delete a rule

Select the desired rule(s) and click the **Delete** button. Confirm deletion.

## Copy a rule

Select the desired rule and click the **Clone** button. Do the proper changes and save after that.

> **Tip:**
> 
> Copying a rule may be useful, for instance, when several rules have to be created with the same criteria but different actions, and you want to avoid the manual creation of rules, one by one. Instead, copy, and edit a specific part of the rule.

> **Note:**
> 
> _Note that the rules will be executed in the order they are listed within the group, i.e., from top to bottom._
