> ## Documentation Index
> Fetch the complete documentation index at: https://docs.feedbackflowhq.com/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.

![Add conditions](https://mintcdn.com/fiscalo/3RoDWdldrUcewlIp/images/xm-and-surveys/surveys/general-features/conditional-logic/editor.webp?fit=max\&auto=format\&n=3RoDWdldrUcewlIp\&q=85\&s=28e365d37a566ca643c029cb1d816ba8)

## 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.

![Add conditions](https://mintcdn.com/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/add-logic.webp?fit=max\&auto=format\&n=SwEMXsdLVsfz0ZXb\&q=85\&s=45386a64ffb963399201eef958f2c32a)

> [!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.

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

![Add conditions](https://mintcdn.com/fiscalo/3RoDWdldrUcewlIp/images/xm-and-surveys/surveys/general-features/conditional-logic/conditions.webp?fit=max\&auto=format\&n=3RoDWdldrUcewlIp\&q=85\&s=f02394e3a17d37b6ef8161cd46a935ad)

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.

![Condition Options](https://mintcdn.com/fiscalo/3RoDWdldrUcewlIp/images/xm-and-surveys/surveys/general-features/conditional-logic/condition-options.webp?fit=max\&auto=format\&n=3RoDWdldrUcewlIp\&q=85\&s=b6374fa8136982841f89123d1750b8ee)

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

![Condition Operators](https://mintcdn.com/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/condition-operators.webp?fit=max\&auto=format\&n=SwEMXsdLVsfz0ZXb\&q=85\&s=596be25aaa4226db9af42446dd1520b9)

* \*\* 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.

![Condition Value](https://mintcdn.com/fiscalo/3RoDWdldrUcewlIp/images/xm-and-surveys/surveys/general-features/conditional-logic/condition-value.webp?fit=max\&auto=format\&n=3RoDWdldrUcewlIp\&q=85\&s=bdac7370b30586a9332c664a9a22423c)

> [!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.

![Condition Chaining](https://mintcdn.com/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/condition-chaining.webp?fit=max\&auto=format\&n=SwEMXsdLVsfz0ZXb\&q=85\&s=86336cf23c24506b0ce68679fcbd6537)

* **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.

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

![Add Actions](https://mintcdn.com/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/action-options.webp?fit=max\&auto=format\&n=SwEMXsdLVsfz0ZXb\&q=85\&s=0ee227ad20f0e6b2d2654c2336de916c)

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.

  ![Action Calculate Variables](https://mintcdn.com/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/action-calculate-variables.webp?fit=max\&auto=format\&n=SwEMXsdLVsfz0ZXb\&q=85\&s=580605959a7f33955e13a0fe6bf033a7)

  ![Action Calculate Operators](https://mintcdn.com/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/action-calculate-operators.webp?fit=max\&auto=format\&n=SwEMXsdLVsfz0ZXb\&q=85\&s=ec65752991dfc8489c9080dc3fc33e0b)

  ![Action Calculate value](https://mintcdn.com/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/action-calculate-value.webp?fit=max\&auto=format\&n=SwEMXsdLVsfz0ZXb\&q=85\&s=f519cae5f1d20fc7f2b11ee621a4d5d7)

  ![Action Calculate](https://mintcdn.com/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/action-calculate.webp?fit=max\&auto=format\&n=SwEMXsdLVsfz0ZXb\&q=85\&s=0dcd3b977bbfc5fbff4076e66dbccb60)

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

![Action Require](https://mintcdn.com/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/action-require.webp?fit=max\&auto=format\&n=SwEMXsdLVsfz0ZXb\&q=85\&s=20cd209e461cabeab58b1a40574e9b22)

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

![Action Jump](https://mintcdn.com/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/action-jump.webp?fit=max\&auto=format\&n=SwEMXsdLVsfz0ZXb\&q=85\&s=976aa7d1effc391dd93383f38d95629b)

* **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.

![Question Logic](https://mintcdn.com/fiscalo/3RoDWdldrUcewlIp/images/xm-and-surveys/surveys/general-features/conditional-logic/question-logic.webp?fit=max\&auto=format\&n=3RoDWdldrUcewlIp\&q=85\&s=a72ee9745639220420827632e4f7ba28)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.