Setting conditions (classic editor)
This page describes the condition designer of the classic editor. To open it, open the question and click Tools ⇒ Condition designer
in the toolbar.
The conditions designer in the classic editor
First, you need to access the conditions designer. To do that, click the question you wish to apply the condition to in the Structure tab:

Now, click Tools in the question toolbar and then Condition designer:

Once accessed, the following page will be displayed:

The conditions designer panel can be divided into three sections:
The conditions designer toolbar
You may find on the toolbar the following options:

- Show conditions for this question: Click on this button to get a quick overview of the existing conditions of your question.
- Add and edit conditions: It represents the default page that opens automatically once you open the Condition designer. It is divided in two parts: (1) a table displaying all the existing conditions and scenarios, and (2) the add/edit conditions menu.
- Copy conditions: Sometimes, you wish to apply the same condition to X questions in order to get questionY displayed at the end. For this, click on Copy conditions. A new window will open displaying the existing conditions of your question (let's call it question3). To add them to question5, check the desired conditions you wish to be copied, select question5, and click on the Copy conditions button below the list. For further information, please continue reading the following wiki section.
- Quick-add conditions: opens a window in which you can add several conditions one after the other without reloading the page. Read below to learn about all the options.
- Move to question: In order not to leave the conditions designer panel while moving to another question, use the following option to select from the dropdown list the next question you wish to apply conditions to. Please note that the dropdown list displays the questions that are displayed in the survey before and after the current question.
Each condition is saved as soon as you add, change or delete it. There is no separate save button. To leave the designer, click another entry in the side menu or the survey or question name in the breadcrumb at the top.
Overview of the existing conditions
This section displays a table that contains all the existing scenarios and conditions of a question. Certain actions can be performed from here:

- Next to the Conditions designer title, two actions are available:
- Delete all conditions - you can delete via this action all the existing conditions and scenarios of your question.
- Renumber scenarios - if clicked, the scenarios will be renumbered with incremental numbers beginning from one. Please note that this option is displayed only if two or more scenarios are applied to your question.
- Quick-add conditions in the toolbar speeds up adding conditions (read below to learn about all the options).

- Next to the name of each scenario there are three buttons that allow you to perform the following actions:
- Delete scenario
- Change scenario number
- Add condition to this scenario - click on this button to add another condition to the desired scenario

- Two actions can be performed on each condition:
- Delete condition
- Edit condition - if clicked, you will be able to edit the condition from the conditions menu

Add/Edit conditions
The bottom part of the screen is allocated to the Add/edit conditions menu:

To understand how the conditions feature works in LimeSurvey, we will first present the elementary conditions.
) that is automatically selected in the condition addition form. It will be covered later within this wiki section.
Definition of elementary conditions
An elementary condition is simply a single condition without any OR or AND logical operators.
It is composed by:
- a left operand: the tested value. You can choose the tested value type by selecting the appropriate tab in the condition editor. It can either be a previous question or a survey participant attribute.

If you select a question-entry (from the Previous questions tab) and if this question uses predefined answers, then the corresponding predefined answers are displayed under the Predefined tab of the comparison value selection.
- not use anonymized responses
- have a participant list.
- a comparison operator. Choose the comparison operator you want to apply from the dropdown list (Less than, Less than or equal to, Equals, Not equal to, Greater than or equal to, Greater than, Regular expression).
- a right operand: the comparison value. You can choose the comparison value type by selecting the appropriate tab in the condition editor: Predefined (an answer option), Constant, Questions (the answer to another question), Participant fields (a participant attribute) or RegExp (a regular expression):

Example of elementary conditions and how to create them
- Show Question 'AAMN' if "the answer to Question 'Gender' is the predefined answer 'Male'"
- tested value = answer to Question 'Gender'
- comparison operator = Equals
- comparison value = predefined answer code (the 'Male' answer in this case)

- Show Question 'Alcohol' if "the answer to Question 'Age' is greater or equal than the numerical value '18'"
- tested value = answer to Question 'Age'
- comparison operator = Greater than or equal to
- comparison value = the constant value '18'

- Show Question 'Alcohol' if "the answer to Question 'BirthDate' is 2000-01-01 or later"
- tested value = answer to Question 'BirthDate'
- comparison operator = Greater than or equal to
- comparison value = '2000-01-01' (the format in the constant field: 2000-01-01)

- Show Question 'Alcohol' if "the 'DrinkingHistory' participant attribute matches the 'Yes' string".
- tested value= the 'DrinkingHistory' value taken from the participant list (Survey participant attributes tab)
- comparison operator = Equals
- comparison value = the constant value 'Yes'

Conditions and scenarios in LimeSurvey
How can I combine conditions?
You can build complex conditions by combining simple conditions with the AND and OR logical operators.

However, it is important to understand that LimeSurvey automatically determines which logical operator to apply. This means that the use of the OR or AND operators is determined according to the context of the condition. In the above example, there is only one scenario. This means that LimeSurvey makes use of Boolean algebra, which means that operator or is "computed" first.
Default condition combinations
As said earlier, LimeSurvey automatically decides which logical operator (AND or OR) should be applied between conditions depending on the 'context'. This applies to both editors, see also Combine conditions for the new editor.
Note also that the order in which you define your elementary conditions is not relevant as LimeSurvey will automatically reorder them according to its own logic.
Let's study this in detail. Two rules should be always remembered:
- First rule: conditions having the same tested value are ORed together
- Second rule: conditions having different tested value are ANDed together
First rule: conditions having the same tested value are ORed together
When you have several conditions, they are ORed together if they share the same tested value. This is the case if the condition applies to several answers belonging to one single question. For example, a condition was applied below to three answers belonging to the same question - if answer to Question 'FavColour' equals 'Blue' OR answer to Question 'FavColour' equals 'Green' OR answer to Question 'FavColour' equals 'Red', then Question 'BirthDate' will be displayed to the survey respondent:

Second rule: conditions having different tested value are ANDed together
When you have several conditions, they are ANDed together if they don't share the same tested values. For example, you may see below the case for several conditions based on different previous questions - "If answer to Question 'Alcohol' equals 'Y' AND answer to Question 'Gender' equals 'F'", then Question 'Alcoholconsumption' will be displayed to the survey respondent:

The multiple options questions
The Multiple choice and Multiple choice with comments question types will be displayed in two flavors:
- a Group of checkboxes flavor which let you set conditions on all possible answers of the respective question;
- a set of Single checkbox entries which lets you set conditions on each checkbox individually.

The group of checkboxes flavour
Now, let's focus on an example to better understand the difference between the two flavours. Let's imagine that we wish to display the 'pointchoice' Question only if the respondent checks at least one of the tested answers listed under the 'MultipleOrganization' Question.
As mentioned above, the group of checkboxes flavor allows you to set conditions on all possible answers of the respective question. Therefore, only the options that refer to responsibilities are selected as comparison values below:

As we can observe, the conditions get ORed due to the Group of checkboxes flavour selected in the beginning:

ANDing conditions in multiple choice questions
Now, let's focus on a similar example. However, we are looking this time only for the most active members to ask them further questions. To do this, we make use of the Single checkbox flavour which allows you to set conditions based on each checkbox individually.
In this example, question X will be displayed if A and B are checked:


Once done, you can observe that the two conditions are ANDed now.

This means that your question will not be displayed unless both tested values (the selected subquestions) are met.
The usage of scenarios - Using ORed conditions between different questions
Now, you may argue that sometimes you need to have ORed conditions even when they are set on different questions (that is to say on different tested values). This is why we got scenarios!
Definition of a scenario
A scenario is simply a manual grouping of conditions in which some conditions are evaluated independently of other conditions from other scenarios. The complex condition resulting in this association of several scenarios will be met only if one scenario is met. In other words, scenarios are logical grouping of conditions, respecting the above rules, and which are ORed together to build complex conditions.
Everything described above applies to the conditions located in every scenario. By default, all the new conditions are created inside the Default scenario, which uses number '1' as its identifier. When you create new conditions, you can choose whether they are added to the default scenario or not. To change the scenario, just use another identifier.
Adding a question to another scenario
When you create (or edit) a condition, you can change the scenario in which the condition is stored by clicking the Add scenario button:

A Scenario field with the number '1' (the default scenario) appears. To add conditions to a different scenario, type a different number in the box. When a question already has several scenarios, the Scenario field is shown right away.
The number id of a scenario has no importance and different scenarios can have non-continuous ids.

You can change the number assigned to a scenario by clicking this icon
(Change scenario number) and assigning the new id to the scenario.

- decide in which order the scenarios are displayed when using the printable version of a survey
- merge conditions from two scenarios (in order to merge scenario 10 with scenario 1, just renumber scenario 10, so that it is scenario 1).
Example: creating three scenarios
To create three scenarios, you need at least three conditions and to add to each of them a different scenario id. Once done, the scenarios are going to be connected among themselves via the 'OR' operator. For example, it could look like this:

AND vs OR in the same scenario
You may end up in certain cases with AND and OR logical operators in the same scenario:

LimeSurvey will always apply first OR. For further details on this, you may check the following Wikipedia article on Boolean algebra.
However, the order of operations can also be observed in the Condition of the question: in the question summary. For the above example, the condition is highlighted below:

As it can be observed, a set of extra parentheses is added for the OR logical operations in order to let the software know that it must be "computed" first.
How to copy conditions
In the classic editor, the copy conditions functionality can be used when you wish to apply the same set of conditions you applied to Question5 to Question10. In this way, you will not have to manually recreate the conditions you applied to the previous question(s).
To start copying conditions, you first have to select the question the condition(s) is/are applied to (Question 'LoWQ' in our case) and click Copy conditions in the toolbar of the condition designer. Then, select the conditions you wish to be copied and select the question you wish to have the conditions added to (Question 'Alcohol' in our case).

Please pay attention to how the copy conditions functions work when you wish to copy and apply a set of conditions located under different scenarios to another question which uses the same or different scenario id numbers. To summarise the possible cases you might have, check the following example:
- you wish to copy Scenario 1 - Condition A, Scenario 1- Condition B, Scenario 7 - Condition C, and Scenario 7 - Condition D from QuestionX into QuestionY
- QuestionY already contains Scenario 1 - Condition A, Scenario - Condition C, Scenario 6 - Condition E, Scenario 8- Condition F.
- Once copied, the following conditions will be applied to QuestionY:
- Scenario 1: Condition A, Condition B, Condition C -> Condition A is not copied anymore as it already exists in QuestionY, only condition B being copied.
- Scenario 6: Condition E -> not affected
- Scenario 7: Condition C, Condition D -> a new scenario is created where the two conditions are added to it
- Scenario 8: Condition F -> not affected
Reset conditions
To quickly delete all the conditions of the survey, click Tools ⇒ Reset conditions in the survey toolbar. The menu entry is only active when the survey has conditions.

Next, confirm on the next page that you want to proceed and all the conditions will be deleted. See also Reset conditions.
Show a question group only sometimes
A question group has a condition of its own. When it is false, LimeSurvey skips the whole group. Open the group and click Edit. Type the expression into Condition. 1 or an empty field means that the group is always shown.
Things to watch out for
Conditions using the 'no answer' predefined answer

Setting the following condition "Show question 'FavColour' if the answer to the question 'Gender' is 'No answer'" really means "show question 'FavColour' if question 'Gender' was displayed to the survey participant who did not submit answer".
Setting conditions for "Other" options in the multiple choice question type
In the multiple choice question type, participants can tick "Other" and type a text. You can't set a condition on the "Other" checkbox itself, but you can test whether the participant typed something into the "Other" text field.
The Previous questions list has an extra entry for this field, for example MultipleOrganization:other: [Other]. Choose it, set the comparison operator Not equal to and the predefined answer No answer. The question then shows only when the participant filled in "Other".
If you need a condition on a real "Other" checkbox, add an explicit answer option called 'Other' and do not use the built-in 'other' option of these question types. Then add an additional short text question which will be displayed if this 'Other' checkbox was clicked.