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

# Conditional Logic

> Create complex survey logic with the Logic Editor. Use conditions, actions, and variables to create a personalized survey experience.

<img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/editor.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=68d840408d0cc339f98d61b0b4ac70c0" alt="Add conditions" width="3216" height="556" data-path="images/surveys/general-features/conditional-logic/editor.webp" />

## Terminology

* **Condition**: A rule that determines when an action should be executed.

* **Action**: A task that is executed when a condition is met.

## **Creating Logic**

* **Add a Logic Block**: Click the `Add logic +` button to add a new logic block.

<img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/add-logic.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=119ccd7224f721b22db7739bb30053e0" alt="Add conditions" width="1688" height="648" data-path="images/surveys/general-features/conditional-logic/add-logic.webp" />

<Note>
  You can add multiple logic blocks to a survey. Logic blocks are executed in
  the order they are added. You can rearrange the order of logic blocks.
</Note>

* **Add Conditions**: Add conditions to the logic block. Conditions are rules that determine when an action should be executed.

<img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/conditions.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=b4cc4d89728d9104f26fb9a60df9f23d" alt="Add conditions" width="1682" height="528" data-path="images/surveys/general-features/conditional-logic/conditions.webp" />

Conditons can be based on:

* **Question**: The answer to a question.

* **Variable**: A variable value.

* **Hidden Field**: The value of a hidden field.2.a **Condition Options**: Choose from a list of available conditions.

<img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/condition-options.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=2391fd451ba2c063020894a33b43a2d6" alt="Condition Options" width="1682" height="818" data-path="images/surveys/general-features/conditional-logic/condition-options.webp" />

* **Condition Operators**: Choose an operator to compare the condition value.

<img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/condition-operators.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=624a9332222e10c9ec83c642230e7be7" alt="Condition Operators" width="1680" height="818" data-path="images/surveys/general-features/conditional-logic/condition-operators.webp" />

* **Condition Value**: Enter a value to compare the condition against.
  Comparisons can be made against a fixed value or a dynamic value.
  Dynamic values can be based on a question, variable, or hidden field.

<img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/condition-value.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=35a86ef00d4b1c48e4030c6984785532" alt="Condition Value" width="1688" height="826" data-path="images/surveys/general-features/conditional-logic/condition-value.webp" />

<Note>
  Conditions can be grouped. Conditions can be combined using AND or OR
  operators. You can add multiple conditions to a logic block. Conditions are
  evaluated in the order they are added.
</Note>

<img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/condition-chaining.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=61eb4d22035dad71ed1e5a367119ed8f" alt="Condition Chaining" width="1606" height="798" data-path="images/surveys/general-features/conditional-logic/condition-chaining.webp" />

* **Add Actions**: Add actions to the logic block. Actions are tasks that are executed when a condition is met.

<Note>
  You can add multiple actions to a logic block. Actions are executed in the
  order they are added.
</Note>

* **Action Options**: Choose from a list of available actions.

<img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/action-options.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=0dfd2325b0f13c72c8507f76666c728c" alt="Add Actions" width="1604" height="540" data-path="images/surveys/general-features/conditional-logic/action-options.webp" />

Action is of the following types:

* **Calculate**: Perform a calculation. These variables are then available for use in other questions.

  * Calculations can be performed on variables.

  * Calculations can be based on fixed values or dynamic values.

  <img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/action-calculate-variables.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=aa5c4cc51fe15f51ff1545bd4f4d31ef" alt="Action Calculate Variables" width="1598" height="526" data-path="images/surveys/general-features/conditional-logic/action-calculate-variables.webp" />

  <img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/action-calculate-operators.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=7a945918de1d0d790602e4338d0872a6" alt="Action Calculate Operators" width="1602" height="828" data-path="images/surveys/general-features/conditional-logic/action-calculate-operators.webp" />

  <img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/action-calculate-value.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=ab452575acbc5a45afd45ac28c860414" alt="Action Calculate value" width="1624" height="830" data-path="images/surveys/general-features/conditional-logic/action-calculate-value.webp" />

  <img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/action-calculate.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=970b73b15e1c680703f1c04539f8768f" alt="Action Calculate" width="1608" height="562" data-path="images/surveys/general-features/conditional-logic/action-calculate.webp" />

* **Require Answer**: Make a question required. Only the optional questions can be marked as required while filling the survey.

<img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/action-require.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=e1d816e2b4d1e732b26df3968248afc2" alt="Action Require" width="1610" height="532" data-path="images/surveys/general-features/conditional-logic/action-require.webp" />

* **Jump to Block**: Skip to a specific block. The user will be redirected to the specified block based on the condition.

<img src="https://mintcdn.com/formbricks/HVXK9qhSV5tjWeAg/images/surveys/general-features/conditional-logic/action-jump.webp?fit=max&auto=format&n=HVXK9qhSV5tjWeAg&q=85&s=864060b650985f5111914b21f8b7e177" alt="Action Jump" width="1604" height="540" data-path="images/surveys/general-features/conditional-logic/action-jump.webp" />

* **Save Logic**: Click the `Save` button to save the logic block.

## Block Logic

This logic is executed when the user reaches the block. Logic can be as simple as showing a follow-up block based on earlier answers or as complex as calculating a score based on multiple answers.

<img src="https://mintcdn.com/formbricks/fuXjoDPfwirx9kHD/images/surveys/general-features/conditional-logic/question-logic.webp?fit=max&auto=format&n=fuXjoDPfwirx9kHD&q=85&s=a04ae8814477e4688f329fd1f55c4f57" alt="Block Logic" width="1608" height="1168" data-path="images/surveys/general-features/conditional-logic/question-logic.webp" />
