Leading Practices and FAQs
Want to see how to take projects from good to great? Check out our Leading Practice & FAQ Home Page!
Alchemer logic features allow you to customize your survey for each respondent, saving them time and you bad data. Logic can be applied to questions, options, pages, and actions. In this tutorial we'll get you started using logic. We'll cover the most common scenarios for using logic, the best tool for each scenario and how to set it up!
Scenario 1: You have a question in a survey that you only want to show to respondents based upon some condition or combination of conditions; for example, how they answered a previous question. Learn how to set up Question Logic.
Scenario 2: You have an entire page in a survey that you only want to show to respondents based upon some condition or conditions. Learn how to set up Page Logic.
Scenario 3: You want to disqualify a respondent or skip them ahead in your survey based upon some condition or conditions. Learn how to set up Skip/Disqualify Logic.
Conditions that logic may be based upon
When logic is processed, a decision is made whether or not to show the element containing that logic. What that decision is based upon is your logic condition: this can be the respondent's answer to Previous Questions, for example.
This can also be many other factors, including:
- System Data - Time Taken on Survey (in seconds), Current Date, Is Mobile (true/false)
- Geo Tracking Data - IP Address, Country, Region, Postal Code, City
- First Party Data - URL Variable*, SSO Variable
- Email Invite Data - Contact ID, Email Address, First Name, Last Name, Organization, Department, Division, Team, Group, Role, Is Manager, Home Phone, Fax Number, Business Phone, Mailing Address, Mailing Address 2. City, State/Region, Postal Code, Country, Title, Custom 1-10. Learn more!
*URL Data can also be used as a condition, meaning a URL variable that has been appended to a respondent's link.
Something important to keep in mind when designing your survey's structure and logic conditions, is that your logic condition must be available at the time the logic is being processed. For example, if you wish to base Page Logic off of a Previous Question, that question must be on a previous page, so that way the respondent's answer to that question has been recorded already.
Each type of logic behaves slightly differently in this regard, allowing for a wide range of flexibility with your logic.
Question Logic is processed dynamically, which means basing logic off of a Previous Question on the same page is allowed. If a condition is on the same page, it must come before the question you are applying the logic to.
Page Logic is processed as the page is being loaded. After the logic has been processed, it will not be re-processed, unless the user/respondent attempts to load that page again (for example, if a respondent were using the "Back" button to go back and change their answers).
Skip/Disqualify Logic is processed as the page is being submitted. Conditions may be on that same page, because the answers will be recorded before processing the logic.
Only show a question based upon the answer to a previous question
For example, in the below survey we ask survey respondents if they will be attending an event. The second question in the survey asks for contact information. We only want to ask respondents to provide contact information if they answer "Yes" to the previous question.
To set this up we will use Question Logic on the question we wish to conditionally show (a.k.a the target question).
1. Edit the target question that you wish to conditionally show.
2. Go to the Logic tab and click the option under Logic Rule to Only show this question based on answers to previous questions or other logic conditions.
3. Using the logic builder, set up the logic condition(s). Logic rules are generally set up as "If/Then" rules, where "If" a certain condition is met, "Then" there is a logical consequence, or reaction from Alchemer.
a. First, select a question from the current page or a previous page that will be used in the IF part of the rule. In the case of a grid question, you will choose a specific row of the grid to use.
b. Next, select the operator that will be used to evaluate the question. After you select your question, the system will apply the recommended operator for the question type you selected. For example, if the question you selected has preset answers, such as a radio button question, Alchemer will switch to the operator "is one of the following answers" along with a list of the possible answers from your selected question:
c. Finally, enter the value or values that are required to complete the rule.
The above pictured rule can be read as, "If Question #1, 'Will you be attending the conference?' is Yes, then show the question."
4. Click Save Question.
When you set up a logic rule like this you are setting up the conditions for when, and only when, this question will be shown. Once you save, this question will be hidden by default and will ONLY show when the conditions you set up are met.
When we preview the page we can confirm that the follow up question "Please provide your contact information below." is hidden by default.
Add this survey to your account to see this question logic in action!
Check out our Question Logic Tutorial to learn more!
Only show an entire page based on the answer to a previous question
For example, on an earlier page in the below survey, we ask survey respondents if they will be attending our conference. We have a series of follow up questions that only apply to those respondents who will be attending the event.
We could set up question logic for each question OR we could set up the logic rule once by using Page Logic. So, we will move all of our questions for respondents who will be attending the conference, to a following page.
1. Edit the page you'd like to conditionally display.
2. Go to the Logic tab and set up your logic conditions using the logic builder under Logic Rule.
a. First, select a question from the current page or a previous page that will be used in the IF part of the rule. In the case of a grid question, you will choose a specific row of the grid to use.
b. Select the operator that will be used to evaluate the question. After you select your question, the system will apply the recommended operator for the question type you selected. For example, if the question you selected has preset answers, such as a radio button question, Alchemer will switch to the operator "is one of the following answers" along with a list of the possible answers from your selected question:
c. Finally enter the value or values that are required to complete the rule.
The above pictured rule can be read as, "If Question #1, 'Will you be attending the event the conference?' is Yes, then show the page."
3. Click Save Page and test that your logic is set up.
When you set up a page logic rule like this you are setting up the conditions for when, and only when, this page will be shown. Once you save, this page will now be hidden by default and will ONLY show when the conditions you set up are met.
To confirm, we'll need to preview from the source question "What kind of pet is it?" If we answer "Dog," the About Your Dog page will display. If we answer anything other than dog, the page will be hidden by default.
Check out our Page Logic Tutorial to learn more!
Skip respondents to a later page in the survey based on the answer to a question
For example, the first question in our pet survey asks "Will you be attending the conference?" Respondents who answer "No" will be skipped to the Thank You Page as the rest of the survey does not apply to them.
To add Page Logic click Skip/Disqualify Logic below the page.
Using the logic builder, set up the Logic Conditions
a. First, select a question from the current page or a previous page that will be used in the IF part of the rule. In the case of a grid question, you will choose a specific row of the grid to use.
b. Select the operator that will be used to evaluate the question. After you select your question, the system will apply the recommended operator for the question type you selected. For example, if the question you selected has preset answers, such as a radio button question, Alchemer will switch to the operator "is one of the following answers" along with a list of the possible answers from your selected question:
c. Finally enter the value or values that are required to complete the rule.
Next select what you would like to do if the logic passes. You can select to send a respondent to a specified Survey Page or to an External URL. You can also select to mark the response as complete or disqualified.
The above pictured rule can be read as, "If Question #1, 'Will you be attending the conference?' is No, then jump to survey page 3: Thank You!"
You can confirm your logic set up on the Build tab of your survey. To test, you will need to preview from the source question "Will you be attending the event?" if you answer "No" and submit the page you will be skipped to the Thank You Page.
Check out our Skip Logic Tutorial to learn more!
Best Practice Tips
- Use Question or Page Logic over Skip Logic wherever possible. Skip Logic is best kept at a minimum; it can get pretty confusing to get logic set up the way you want when there are too many skips happening in your survey.
- Only use the "is exactly equal to" operator or the "is not exactly equal to" operator with text fields.
- Avoid negative logic. It can be pretty difficult to wrap your head around all this logic and to get it set up correctly. If you do choose to use negative logic check out our tutorial on Understanding Negative Logic.
- If you are using multiple conditions, use groups. Visit our Using Multiple Conditions and Groups in Logic Rules article to learn more!
- Alchemer logic is based on the reporting values that are assigned to your answer options. If you have identical reporting values for any two or more answer options, the logic condition will not be able to differentiate between the answer options.