> ## 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/yKl9MUpEW6O1uJ5B/images/xm-and-surveys/surveys/general-features/conditional-logic/editor.webp?fit=max&auto=format&n=yKl9MUpEW6O1uJ5B&q=85&s=a3e01cde7d905b574196d263b8c0845f" alt="Add conditions" width="3216" height="556" data-path="images/xm-and-surveys/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/yKl9MUpEW6O1uJ5B/images/xm-and-surveys/surveys/general-features/conditional-logic/add-logic.webp?fit=max&auto=format&n=yKl9MUpEW6O1uJ5B&q=85&s=39d0b46d702d340cc22e07e35477788f" alt="Add conditions" width="1688" height="648" data-path="images/xm-and-surveys/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/yKl9MUpEW6O1uJ5B/images/xm-and-surveys/surveys/general-features/conditional-logic/conditions.webp?fit=max&auto=format&n=yKl9MUpEW6O1uJ5B&q=85&s=411a1f36f6ee17300653aa91712bc64a" alt="Add conditions" width="1682" height="528" data-path="images/xm-and-surveys/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/yKl9MUpEW6O1uJ5B/images/xm-and-surveys/surveys/general-features/conditional-logic/condition-options.webp?fit=max&auto=format&n=yKl9MUpEW6O1uJ5B&q=85&s=6946f6427e41d67c56c9767e5ad1a6df" alt="Condition Options" width="1682" height="818" data-path="images/xm-and-surveys/surveys/general-features/conditional-logic/condition-options.webp" />

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

<img src="https://mintcdn.com/formbricks/yKl9MUpEW6O1uJ5B/images/xm-and-surveys/surveys/general-features/conditional-logic/condition-operators.webp?fit=max&auto=format&n=yKl9MUpEW6O1uJ5B&q=85&s=e9b8acc835d986171af387cc3085ee72" alt="Condition Operators" width="1680" height="818" data-path="images/xm-and-surveys/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/yKl9MUpEW6O1uJ5B/images/xm-and-surveys/surveys/general-features/conditional-logic/condition-value.webp?fit=max&auto=format&n=yKl9MUpEW6O1uJ5B&q=85&s=92ed9ad191e30552192f249eae4c955b" alt="Condition Value" width="1688" height="826" data-path="images/xm-and-surveys/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/yKl9MUpEW6O1uJ5B/images/xm-and-surveys/surveys/general-features/conditional-logic/condition-chaining.webp?fit=max&auto=format&n=yKl9MUpEW6O1uJ5B&q=85&s=449f60d93552b2fcf59274519b1ade6c" alt="Condition Chaining" width="1606" height="798" data-path="images/xm-and-surveys/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/yKl9MUpEW6O1uJ5B/images/xm-and-surveys/surveys/general-features/conditional-logic/action-options.webp?fit=max&auto=format&n=yKl9MUpEW6O1uJ5B&q=85&s=c53ca1cb7b16b86e54beb80d2424d4c1" alt="Add Actions" width="1604" height="540" data-path="images/xm-and-surveys/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/yKl9MUpEW6O1uJ5B/images/xm-and-surveys/surveys/general-features/conditional-logic/action-calculate-variables.webp?fit=max&auto=format&n=yKl9MUpEW6O1uJ5B&q=85&s=56e7fa1d96ac3a3fa1011bd664be2e8e" alt="Action Calculate Variables" width="1598" height="526" data-path="images/xm-and-surveys/surveys/general-features/conditional-logic/action-calculate-variables.webp" />

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

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

  <img src="https://mintcdn.com/formbricks/yKl9MUpEW6O1uJ5B/images/xm-and-surveys/surveys/general-features/conditional-logic/action-calculate.webp?fit=max&auto=format&n=yKl9MUpEW6O1uJ5B&q=85&s=fb7b71242ab5f950635213dca823f0b2" alt="Action Calculate" width="1608" height="562" data-path="images/xm-and-surveys/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/yKl9MUpEW6O1uJ5B/images/xm-and-surveys/surveys/general-features/conditional-logic/action-require.webp?fit=max&auto=format&n=yKl9MUpEW6O1uJ5B&q=85&s=aa892aface5aee986b08b462e494143b" alt="Action Require" width="1610" height="532" data-path="images/xm-and-surveys/surveys/general-features/conditional-logic/action-require.webp" />

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

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

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

## Question Logic

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

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