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

<img src="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" 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/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/add-logic.webp?fit=max&auto=format&n=SwEMXsdLVsfz0ZXb&q=85&s=45386a64ffb963399201eef958f2c32a" 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/fiscalo/3RoDWdldrUcewlIp/images/xm-and-surveys/surveys/general-features/conditional-logic/conditions.webp?fit=max&auto=format&n=3RoDWdldrUcewlIp&q=85&s=f02394e3a17d37b6ef8161cd46a935ad" 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/fiscalo/3RoDWdldrUcewlIp/images/xm-and-surveys/surveys/general-features/conditional-logic/condition-options.webp?fit=max&auto=format&n=3RoDWdldrUcewlIp&q=85&s=b6374fa8136982841f89123d1750b8ee" 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/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/condition-operators.webp?fit=max&auto=format&n=SwEMXsdLVsfz0ZXb&q=85&s=596be25aaa4226db9af42446dd1520b9" 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/fiscalo/3RoDWdldrUcewlIp/images/xm-and-surveys/surveys/general-features/conditional-logic/condition-value.webp?fit=max&auto=format&n=3RoDWdldrUcewlIp&q=85&s=bdac7370b30586a9332c664a9a22423c" 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/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/condition-chaining.webp?fit=max&auto=format&n=SwEMXsdLVsfz0ZXb&q=85&s=86336cf23c24506b0ce68679fcbd6537" 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/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/action-options.webp?fit=max&auto=format&n=SwEMXsdLVsfz0ZXb&q=85&s=0ee227ad20f0e6b2d2654c2336de916c" 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/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" 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/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" 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/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" 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/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/action-calculate.webp?fit=max&auto=format&n=SwEMXsdLVsfz0ZXb&q=85&s=0dcd3b977bbfc5fbff4076e66dbccb60" 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/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/action-require.webp?fit=max&auto=format&n=SwEMXsdLVsfz0ZXb&q=85&s=20cd209e461cabeab58b1a40574e9b22" 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/fiscalo/SwEMXsdLVsfz0ZXb/images/xm-and-surveys/surveys/general-features/conditional-logic/action-jump.webp?fit=max&auto=format&n=SwEMXsdLVsfz0ZXb&q=85&s=976aa7d1effc391dd93383f38d95629b" 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/fiscalo/3RoDWdldrUcewlIp/images/xm-and-surveys/surveys/general-features/conditional-logic/question-logic.webp?fit=max&auto=format&n=3RoDWdldrUcewlIp&q=85&s=a72ee9745639220420827632e4f7ba28" alt="Question Logic" width="1608" height="1168" data-path="images/xm-and-surveys/surveys/general-features/conditional-logic/question-logic.webp" />
