> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowforma.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Conditions

> Set conditions on FlowForma business rules with the conditions editor, combining rules and nested groups using AND and OR logic to control when a rule runs.

The conditions editor has been updated to allow you to enter grouped conditions more easily into business rules.

<Info>
  [Business rules](/product/creating-flows/business-rules/overview) that were entered using the old conditions editor aren't affected. If you click **Edit conditions**, the old conditions editor is displayed and operates as before.
</Info>

<Info>
  If you click **Clear conditions** on a business rule that had conditions entered using the old conditions editor, the conditions are removed. When you then click **Edit conditions**, the new conditions editor is displayed.
</Info>

<Info>
  If you click **Edit conditions** on a business rule created before the conditions editor was updated that has no conditions entered, or on a new business rule, the new conditions editor is displayed.
</Info>

Each time you create a business rule, you can set conditions to control when the rule runs. If you don't set conditions, the rule always runs. If you set conditions, the rule only runs when the conditions you set are met.

You'll find the conditions in the first section of the rule editor.

To set or edit conditions for a rule, click **edit conditions** to open the conditions editor. To remove all conditions, click **clear conditions.**

<img src="https://mintcdn.com/flowforma/29tXFCtk1ynp2c5R/images/product/creating-flows/business-rules/conditions/conditions-1.png?fit=max&auto=format&n=29tXFCtk1ynp2c5R&q=85&s=9f593249f1493a1c90e851ff4b5de205" alt="Rule editor with edit conditions and clear conditions options" width="611" height="547" data-path="images/product/creating-flows/business-rules/conditions/conditions-1.png" />

When you click **Edit conditions**, the following screen is displayed for you to enter the conditions.

<img src="https://mintcdn.com/flowforma/29tXFCtk1ynp2c5R/images/product/creating-flows/business-rules/conditions/conditions-2.png?fit=max&auto=format&n=29tXFCtk1ynp2c5R&q=85&s=18a27c5c29cdc2b3c479f102e9d911c8" alt="Conditions editor screen" width="826" height="269" data-path="images/product/creating-flows/business-rules/conditions/conditions-2.png" />

In the top left corner is an AND / OR option for you to define whether the conditions for each rule or group of rules has to be met **AND**, or whether the conditions for only one of the rules or groups of rules has to be met **OR.**

On the top right of the screen are two buttons, **Add rule** and **Add group**.

**Add rule** - this adds a single line to the editor. Rules can be added individually or within a group.

In the example below AND has been selected and two individual rules have been added.

For the business rule to execute

Yes / No question 1 must equal Yes

**AND**

Yes / No question 2 must equal Yes.

<img src="https://mintcdn.com/flowforma/Ttfqzt1QnXujKlYY/images/product/creating-flows/business-rules/conditions/conditions-3.png?fit=max&auto=format&n=Ttfqzt1QnXujKlYY&q=85&s=0ee23eae9fce40d78063d5c26bf01564" alt="Two individual rules joined with AND" width="828" height="312" data-path="images/product/creating-flows/business-rules/conditions/conditions-3.png" />

In the example below OR has been selected and two individual rules have been added.

For the business rule to execute

Yes / No question 1 must equal Yes

**OR**

Yes / No question 2 must equal Yes

<img src="https://mintcdn.com/flowforma/Ttfqzt1QnXujKlYY/images/product/creating-flows/business-rules/conditions/conditions-4.png?fit=max&auto=format&n=Ttfqzt1QnXujKlYY&q=85&s=101e3778a74a807f1a483d3c482153b8" alt="Two individual rules joined with OR" width="830" height="313" data-path="images/product/creating-flows/business-rules/conditions/conditions-4.png" />

**Add group** - this adds a group to the editor so you can add a group of conditions. Each group of conditions is evaluated separately.

Click **Add group** and a new group is added.

<img src="https://mintcdn.com/flowforma/Ttfqzt1QnXujKlYY/images/product/creating-flows/business-rules/conditions/conditions-5.png?fit=max&auto=format&n=Ttfqzt1QnXujKlYY&q=85&s=53894b80b772664c1b7c45ec8e517998" alt="New group added to the conditions editor" width="857" height="320" data-path="images/product/creating-flows/business-rules/conditions/conditions-5.png" />

You can now add rules or groups to this group. These conditions are evaluated separately from other rules and groups.

In the example below, two groups have been added, and within each group another group has been added.

AND has been selected at the top of the conditions editor, so each group of conditions must be met for the business rule to execute.

In this case

Yes / No question 1 must Equal yes

         AND Text question 1 must Not be blank

        AND Text question 2 must not be blank

**AND**

Yes / No 2 question must Equal yes

       AND Text question 3 must Not be blank

       AND Text question 4 must not be blank

<img src="https://mintcdn.com/flowforma/Ttfqzt1QnXujKlYY/images/product/creating-flows/business-rules/conditions/conditions-6.png?fit=max&auto=format&n=Ttfqzt1QnXujKlYY&q=85&s=6fde7be3beb11a643dcc9aae985585aa" alt="Two groups with nested groups joined by AND" width="889" height="709" data-path="images/product/creating-flows/business-rules/conditions/conditions-6.png" />

If you change the selection at the top to OR

<img src="https://mintcdn.com/flowforma/Ttfqzt1QnXujKlYY/images/product/creating-flows/business-rules/conditions/conditions-7.png?fit=max&auto=format&n=Ttfqzt1QnXujKlYY&q=85&s=b078838a4d40f3c17a8cbe56b060ca1f" alt="Top selection changed to OR" width="881" height="702" data-path="images/product/creating-flows/business-rules/conditions/conditions-7.png" />

For the conditions to be met and the business rule executed

Yes / No question 1 must Equal yes

         AND Text question 1 must not be blank

         AND Text question 2 must not be blank

**OR**

Yes / No 2 question must Equal yes

        AND Text question 3 must not be blank

        AND Text question 4 must not be blank

Changing the AND / OR selection within groups changes how the conditions operate.

In the example below, the selection for the groups within the two groups has been changed to OR.

<img src="https://mintcdn.com/flowforma/Ttfqzt1QnXujKlYY/images/product/creating-flows/business-rules/conditions/conditions-8.png?fit=max&auto=format&n=Ttfqzt1QnXujKlYY&q=85&s=5f3c0c16eff7dada15c83e511b87efa1" alt="Group selections changed to OR" width="877" height="703" data-path="images/product/creating-flows/business-rules/conditions/conditions-8.png" />

For the conditions to be met and the business rule executed

Yes / No question 1 must Equal yes

         AND Text question 1 must not be blank

         OR Text question 2 must not be blank

**OR**

Yes / No 2 question must Equal yes

          AND Text question 3 must not be blank

          OR Text question 4 must not be blank

## Writing conditions

The first column in the editor lets you select a question from your flow. The drop-down list contains all the steps in your flow. If you click a step name, it expands to show all the questions on that step.

<img src="https://mintcdn.com/flowforma/Ttfqzt1QnXujKlYY/images/product/creating-flows/business-rules/conditions/conditions-9.png?fit=max&auto=format&n=Ttfqzt1QnXujKlYY&q=85&s=50d85ae781728d0f47492777e77d3c55" alt="Selecting a question from the drop-down list" width="826" height="299" data-path="images/product/creating-flows/business-rules/conditions/conditions-9.png" />

When you have selected a question the drop-down list in the second column contains all condition types. Select the relevant option.

<img src="https://mintcdn.com/flowforma/29tXFCtk1ynp2c5R/images/product/creating-flows/business-rules/conditions/conditions-10.png?fit=max&auto=format&n=29tXFCtk1ynp2c5R&q=85&s=22ab5ee8eb18fc18adbc6a309e5acf90" alt="Condition types drop-down list" width="825" height="298" data-path="images/product/creating-flows/business-rules/conditions/conditions-10.png" />

* **Is blank**: nothing can be entered in the question selected in the first column. The third column is disabled for this condition.
* **Not blank**: something has to be entered in the question selected in first column, it can't be left blank. The third column is disabled for this condition.
* **Equals**: what has been entered in the question selected in the first column **MUST** match what you entered in the third column. You can select the answer of another question or insert a value into the third column.
* **Not equals**: what has been entered in the question selected in the first column **MUST NOT** match what you entered in the third column. You can select the answer of another question or insert a value into the third column.
* **Contains**: what has been entered in the question selected in the first column **MUST CONTAIN** what has been entered in the third column, but it doesn't have to be limited to that. You can select the answer of another question or insert a value into the third column.
* **Not contains**: what has been entered in the question selected in the first column **MUST NOT CONTAIN** what has been entered in the third column, but can be anything else. You can select the answer of another question or insert a value into the third column.
* **Greater than**: this only applies to numeric values, and the user must enter a number that's greater than this value. You can select the answer of another question or insert a value into the third column.
* **Greater or equals:** this only applies to numeric values, and the user must enter a number that's greater than or equal to this value. You can select the answer of another question or insert a value into the third column.
* **Less than**: this only applies to numeric values, and the user must enter a number that's less than this value. You can select the answer of another question or insert a value into the third column.
* **Less or equals:** this only applies to numeric values, and the user must enter a number that's less than or equal to this value. You can select the answer of another question or insert a value into the third column.
* **Matches pattern**: what has been entered in the question selected in the first column MUST match the selected pattern.

  You can add an "@" **and** a "." for a quick and easy valid email address check, or "@flowforma.com" to ensure it's from a FlowForma email address.

  Pattern matching is most useful when you use regular expressions to define complex conditions, so you can check if names begin with capital letters, or separate a 16-digit number into groups of 4 with a hyphen.
* **Does not match pattern:** this works the same as **matches pattern** but checks that the value does not match a specified pattern.

The third column contains the item that's compared to the value selected in the first column, based on the condition selected in the second column. The **and/or** options let you define whether all the conditions must be met. You can combine these values to create complex sets of conditions.

<img src="https://mintcdn.com/flowforma/29tXFCtk1ynp2c5R/images/product/creating-flows/business-rules/conditions/conditions-11.png?fit=max&auto=format&n=29tXFCtk1ynp2c5R&q=85&s=0be8a32a29523a472dadecbb21f78de9" alt="Third column comparison values" width="827" height="269" data-path="images/product/creating-flows/business-rules/conditions/conditions-11.png" />

To delete a condition, click **delete**. This is permanent and can't be undone. However, if this is an existing condition, you can close it to prevent changes and deletions from being saved.

<img src="https://mintcdn.com/flowforma/29tXFCtk1ynp2c5R/images/product/creating-flows/business-rules/conditions/conditions-12.png?fit=max&auto=format&n=29tXFCtk1ynp2c5R&q=85&s=3d02d8e276ad6cd20306c9b5b48b1d28" alt="Delete a condition" width="833" height="269" data-path="images/product/creating-flows/business-rules/conditions/conditions-12.png" />

To delete a conditions group click **delete** next to the group. This is permanent and can't be undone. However, if this is an existing condition, you can close it to prevent changes and deletions from being saved.

<img src="https://mintcdn.com/flowforma/29tXFCtk1ynp2c5R/images/product/creating-flows/business-rules/conditions/conditions-13.png?fit=max&auto=format&n=29tXFCtk1ynp2c5R&q=85&s=b02878ac8320e059d81fe8f328ad1422" alt="Delete a conditions group" width="881" height="328" data-path="images/product/creating-flows/business-rules/conditions/conditions-13.png" />

After you've entered conditions, they're displayed in the rule editor.

<img src="https://mintcdn.com/flowforma/29tXFCtk1ynp2c5R/images/product/creating-flows/business-rules/conditions/conditions-14.png?fit=max&auto=format&n=29tXFCtk1ynp2c5R&q=85&s=b260bcefc5d2844fed8fb7fad4a98b05" alt="Conditions displayed in the rule editor" width="605" height="612" data-path="images/product/creating-flows/business-rules/conditions/conditions-14.png" />

They're also included in the rule summary in the **[Flow designer](/product/creating-flows/flow/flow-designer/overview)**.

<img src="https://mintcdn.com/flowforma/29tXFCtk1ynp2c5R/images/product/creating-flows/business-rules/conditions/conditions-15.png?fit=max&auto=format&n=29tXFCtk1ynp2c5R&q=85&s=b02e741a5d7287491e676489a0f0abe9" alt="Conditions in the rule summary in the Flow designer" width="934" height="540" data-path="images/product/creating-flows/business-rules/conditions/conditions-15.png" />

If you want to edit a condition that has already been created, click **edit conditions** and amend any of the fields displayed in the panel, or add additional ones if required, or remove ones that are no longer required.

When you've made all entries or amendments, click **OK**. All conditions entered in the rule are saved, and you're returned to the **rule editor**.
