Conditional Logic Overview
Conditional Logic lets you create dynamic surveys that change what a respondent sees and what happens based on their responses. Essentially, you can create different actions triggered by different survey responses. Logic can be set to hide questions or instructions, finish a survey early, redirect respondents to a URL on completion and set or append messages to the finish text depending on the respondent's answers.
Make sure you test carefully
Conditional Logic can be simple or quite complex depending upon the number of actions, conditions and triggers specified. It requires careful and meticulous planning, execution, testing and piloting in order to avoid errors and ensure the survey objectives are met. Where possible, keep the logic as simple as possible.
Survey Template "Preview" includes logic to allow testing
Logic is applied when previewing a survey template. This allows user testing of the logic before launching a project. The responses are not saved.
Conditional Logic is included when copying survey templates
Conditional Logic is included when using the Survey Template Copy feature. For the Consultant and Enterprise Plans, survey templates copied from one Spark Chart account to another account will also copy the logic.
Elements of Conditional Logic
Logic is structured with three components: Actions, Triggers and Conditions.
Actions are what you want to happen when responses meet defined Conditions and Triggers. Actions include:
- Hide selected content, e.g. questions or instructions (this is sometimes called skip logic)
- Finish the survey
- Redirect to a specified url on finish
- Change the finish message (HTML options are available)
- Append text to the finish message (HTML options are available)
- Send an email when the survey is complete
- Send a Slack notification when the survey is complete
- Tag the participant when the survey is complete. For tagging, a single or multiple tags can be set for an action and conditions. Tags will be created automatically. The tagged respondents will show in Tags under the Participant menu. Tags will be merged and not duplicated.
- More actions are planned
Triggers are defined responses to survey questions. Triggers can be set for either the current question or earlier questions. Each trigger has answer options to check against. These options vary depending upon the question type. Triggers include:
- Is equal to/Is not equal to: Does a strict comparison with the answer. The answer supplied must exactly equal the selection. Multiple choice answers must have all and only the answers specified in the logic to fire. This option is not available for free text questions.
- Contains/Does not contain: This option is only available for free text responses. It checks to see if a response contains a word or sentence.
- Is one of/Is not one of: This is a non-strict equal to comparison and checks if answers contain certain responses.
- Is more than/Is less than: A comparator that is only available for Rating Scales questions. It checks to see if the answer is higher or lower than specified.
- Is more than or equal to/Is less than or equal to: The same as more than/less than but it includes the specified value.
Conditions contain one or multiple Triggers that, if met, will result in the Action. Conditions can be set to meet "any" or "all" Triggers.
How to add Conditional Logic to a survey
Logic Display Options
On initial sign up to Spark Chart, logic is displayed as Action first and then the Condition. If you prefer to view logic with the Condition first, there is an option to change the display format.
To change the display layout, go to your Profile/Settings and User Interface then toggle between "Condition > Action" and "Action > Condition".
Add Logic to a question
In the Survey Template content, click the Logic button alongside survey questions to add or edit logic for a question.
The Conditional Logic Window
In the Conditional Logic window you can define actions to be taken when specified conditions and triggers are met.
The "+ New Action" button at the top right creates an Action for the question. Each action is treated as a separate container with it's own Conditions and Triggers. Multiple actions can be set.
Conditions create the rules for the Action to occur. Conditions contain Triggers for the action. For each action, you can add a single or multiple Conditions and specify if "all" or "any" of the Conditions must be met for the action to occur.
A Trigger is a defined survey response or set of responses. For each Condition, you can add a single or multiple Triggers and specify if "all" or "any" Triggers are required to satisfy the Condition.
To remove an Action, Condition or Trigger simply select the cross (X) alongside the element.
Here are a couple of examples of logic attached to questions.
In the following example for a Yes/No multiple choice question, three logic Actions have been set. Two actions relate to a No response and one action relates to a Yes response.
1. Action = Finish the survey immediately. The Condition contains one Trigger = When the response Is equal to "No".
2. Action = When the survey is complete, append text to the finish message. The Condition contains one Trigger = When the response Is equal to "No".
3. Action = When the survey is complete, append text to the finish message. The Condition contains one Trigger = When the response Is equal to "Yes".
In the following example for a multiple choice question with three options (Fish, Cat and Dog) and multiple answers allowed, the logic is set to hide (or skip) questions depending upon the responses to the question. If the response does not include "Fish" then the fish questions are hidden. If the response does not include "Cat" then the cat questions are hidden. If the response does not include "Dog", the dog questions are hidden. There are three actions.
1. Action = Hide content (the Fish Questions). The Condition contains one Trigger = When the response is Not one of "Fish". So, unless Fish is selected then the Fish questions will not show.
2. Action = Hide content (the Cat Questions). The Condition contains one Trigger = When the response is Not one of "Cat". So, unless Cat is selected then the Cat questions will not show.
2. Action = Hide content (the Dog Questions). The Condition contains one Trigger = When the response is Not one of "Dog". So, unless Dog is selected then the Dog questions will not show.