Using conditions in surveys

Creating Surveys Using Conditional LogicĀ 
As you design your survey, you can add conditions. Conditions control which questions, pages and choices a respondent sees. They help you ask only what matters and improve the quality of your data.


mWater checks conditions as the respondent answers. You can base a condition on a question on the same page, as long as that question comes before the one you add the condition to.


You can also use conditions on pages. A page is shown or skipped based on an answer on an earlier page.


You can also view this video for a guided demonstration of using conditional logic.

Overview

Show or hide questions based on earlier answers
Conditions let you include or exclude questions based on the answers a respondent gave earlier. This is also called skip logic or branching.

It works like this: show this question only if the condition is met.

In the design view, a question with a condition shows its rule in italics above it (left). In the survey, the question only appears once the condition is met (right).

Logic Types

Conditions can be added to questions, pages and choices. Each type works slightly differently:

Question Logic

Page Logic

Question Logic
Question Logic
Page Logic
Page Logic

Condition Settings

Setting up a condition
The condition builder changes based on the question you pick. The operators you see depend on the question type. For a choice question you can use:Number questions also offer operators such as is equal to, is greater than and is less than. Checkbox questions use is checked.

Question Logic

Only show a question based on the answer to an earlier question
In the example below, we ask if the water point has a water management committee. We only want to ask "What is your role on the water committee?" if the box is checked.

Before the box is checked, the role question is hidden (left). Once it is checked, the role question appears (right).

Set up the condition

Add the condition to the question you want to show or hide (the target question).
  1. Hover over the target question and click Edit.
  2. Scroll down to Conditions and click + Add Condition.
  3. Use the drop-downs to build the rule.

a. First, select the question that the rule depends on. It can be on the current page or an earlier page. For a matrix question, choose the row to use.
b. Next, select the operator. The list only shows operators that fit the question type.
c. Finally, select or enter the value to compare against. For "is one of", you can pick more than one choice.

Click + Add Condition again to add more rules. The question only shows if all the rules are true. Click Save when you are done.

The rule below reads as: "Show this question if the committee box is checked and the main drinking water source is Borehole / tubewell."

Page Logic

Only show a page based on an answer on an earlier page
If your survey has more than one page, you can show or skip a whole page. For example, if a respondent does not give consent on the first page, you can skip the pages that follow.

Set up the condition

Setting up page logic works the same way as question logic.
  1. Hover over the page heading and click Edit.
  2. In the Edit Page window, a page is set to Always show by default. Click + Add Condition.
  3. Use the drop-downs to build the rule, then click Save.

a. First, select a question from an earlier page. For a matrix question, choose the row to use.
b. Next, select the operator. The list only shows operators that fit the question type.
c. Finally, select or enter the value to compare against.

In the example above, the Water page only shows if the location of the household was answered.

Advanced Conditions

Choice Conditions

You can also show or hide a single choice in a choice question. This keeps the list short and relevant.
  1. Open the question's Edit window.
  2. Under the choice, click + Add conditions.
  3. Under Display only if, click + Add Condition and build the rule.
To remove the rule, click Remove conditions.

Visualize Conditions

Use Visualize Conditions to check the logic of the whole survey in one place. In the Design tab, open the Tools menu and click Visualize Conditions.

Click any page or question on the left. The right side shows:

Best Practices

Test your conditions
After you add a condition, save it and test your survey. Use Preview and the Interactive Preview to check that each path works. Make sure one condition works before you add more.

Best practice tips