Page logic, also sometimes referred to as skip logic, allows you to customize the flow of your survey to present only relevant sections of the survey to respondents or complete other actions. When your specified condition is met, you can:
- Skip pages or direct respondents to a relevant section in your survey.
- Redirect respondents to another survey or website.
- Display a customized message.
- Screen respondents based on panel or quota rules.
- End the survey.
Conditional page logic can be thought of as “If…Then” statements. If a condition or set of conditions are true, then complete a certain action.
As an example, a country club may ask if a respondent uses the swimming pool; if the respondent answers no, then automatically skip the page that includes questions about the pool, since those questions are not relevant to the respondent.
You can also perform unconditional page logic, which will complete an action for any respondent who reaches and completes a page of your survey. We’ll discuss some common uses for unconditional page logic later in this article.
Page Logic Elements
Before we cover how to add page logic to your survey, we must first discuss some of the different elements that can be used within the page logic module.
Page Logic Conditions
Conditions are the “if” part of the “if…then…” structure discussed above. These are criteria that you want to test, and only if the respondent or the responses match those criteria will the survey proceed with the actions specified. There are three different condition types that you can use:
- Questions: Create actions based on responses to a question or a set of questions on the current page or any previous page. For example, you may ask respondents if they want to be contacted, and, if they choose yes, direct them to a page where they can enter contact details, otherwise skip to the next questions.
- Quotas: Add page logic based on quotas that you set up. For example, if you want the first 50 respondents to receive a gift card, you could redirect them to a website where they can claim their gift.
- Custom Fields: Set up actions based on information you have already entered about respondents. For example, for an employee feedback survey you may choose to enter an employee’s region, department, and title as custom fields. You can then have one single survey for your organization but ask specific questions relevant to each respondent based on their role, location, or position.
You can also set up Unconditional page logic. In this case, the action will be completed for all respondents who reach that page when they click the “Next” or “Submit” button at the end of the page.
We will discuss each of these condition types, as well as unconditional page logic, in further detail below. You can also view our separate article on Page Logic Conditions.
Different condition types and question types will have different logic operators (is exactly equal to, greater than, less than, etc). For a complete discussion on logic operators, please visit our separate help article on Logic Operators.
Page Logic Actions
In setting up page logic, you must also specify what action will be taken when the page logic conditions are met. You have 7 options:
|Jump to Page||Takes a respondent to a specified page in your survey.|
Note: “Jump to Page” cannot be used in a single-page survey or on the last page of a survey.
|End Survey||Automatically end the survey for the respondent and display the survey completion message. By default, the response will be marked as Complete. However, you can use the Advanced Settings to mark the response as Partial.|
|Redirect to Website||Redirect the respondent to a specified website URL.|
|Show a Message||Enter a customized message that will be displayed to the respondent when the page logic evaluates to true.|
|Redirect to Another Survey||Direct the respondent to another survey in your SurveyMethods account.|
Note: To redirect to a survey, the destination survey has to be live or launched at least once. If the survey is closed, the respondent will see a message telling them that the survey is closed and will not be able to complete the second survey.
|Quota Action||Perform the action specified in one of your quotas. Possible quota actions include closing the survey, redirecting respondents to a website, showing a message, redirecting to another survey, and panel integration actions.|
Note: You can only use quota actions in page logic if you have at least one active quota configured.
|Panel Integration||Configure redirection URLs for use with panel integration.|
Groups and Subgroups
SurveyMethods allows you to set up Groups and Subgroups to evaluate different criteria simultaneously as well as determine the order in which criteria are evaluated.
When you create your first page logic condition, it is automatically assigned to its own new group. You can rename the group by clicking on the group title at the top left:
You can add additional conditions within a group by clicking the “+ Add Condition” link below the last condition in the group. Once you have more than one condition defined, you will see a dropdown between each condition with two options – And and Or:
If you set the operator to And, BOTH conditions will have to be met for the action to take place, while if you set the operator to Or, EITHER condition can be true and the specified action will be taken.
In the example above, the survey will end if a respondent either responds No to the question “Do you use ACME’s household care products?” or selects Under 18 or 19 – 25 on the question asking for the respondent’s age.
If instead the operator was changed to And, the respondent would have to meet both conditions (not be a user of ACME’s products AND fall into the Under 18 or 19 – 25 age groups) in order for the action to be taken. In this scenario, if either condition is not met, the action will not be taken.
Each group has its own action and will be treated separately. To create a second page logic group, simply choose Add Group at the top right of any of the existing groups.
This will create a new group just below the existing group with its own condition(s) and action:
Groups are evaluated from the top down, so in the event conditions for more than one group are met, the action for whichever group is listed first will be taken. In the example above, if the “End Survey” group conditions are met, the survey will be ended and the action from the “Parents” group will not be evaluated. You can reorder groups by clicking on the crossed arrows icon (to the left of the group name) and dragging it up or down to reorder.
Subgroups are sets of conditions that are grouped together within a group, creating a hierarchy to determine order of condition testing. You can use subgroups of groups (and subgroups of subgroups) to create complex sets of conditions and also to ensure that conditions are tested in the desired order.
In the example below, you can think of the subgroup as creating parentheses around the two conditions within it. So the subgroup ensures that the two conditions are tested first before the “Or” operator after the second condition is tested.
What this example does is essentially create two groups:
- Respondents in the Above 55 age group who also have 2 or more children (note the And operator before conditions one and two).
- Respondents in any of the 26 – 35, 36 – 45, or 46 – 55 age groups who also have at least 1 child (notice the And operator within the subgroup).
The Or logic between condition two and the subgroup, means that if a respondent falls into either category, the specified action (Jump to Page 3) will be taken.
You can rename subgroups just like you name groups, or add conditions within subgroups in the same way you add conditions to groups. You can also add subgroups within subgroups by clicking the “Add Subgroup” link on the top right of the subgroup.
Order of Operations
Subgroups are used to create bracketed expressions, so the lowest-level subgroup is tested first before working up the hierarchy. Conditions are evaluated according to logical operator precedence rules (Boolean Logic – AND, then OR).
In this example, conditions are evaluated in the following order:
- The condition in the subgroup “Type of cell phone” is evaluated.
- The condition in the subgroup “Cell phone” is evaluated. The system will then test whether this AND condition 1 are true.
- The condition in the subgroup “Age group” is evaluated. The system will then test whether this AND the result of the combined condition 1 and 2 are true.
- The condition in the main group “Male smartphone users in 25-34 age group” is evaluated. The system will then test whether this AND the result of the combined condition 3 and 1 and 2 are true.
If the result of all of these tests is true, the action (redirect to website https://www.somewebsite.com) will be taken.
Deactivating or Deleting Page Logic
If you would like to remove a specific page logic group, you have two options – you can delete it (permanent) or deactivate it (remains in the survey and can be reactivated later).
To deactivate a page logic group, simply uncheck the “Active” box at the top right of the group. To delete a page logic group, click the Delete Group button and then confirm that you want to delete on the pop-up that appears on the screen.
Subgroups can be deleted in the same way that groups are deleted, by clicking the Delete Subgroup link on the top right of the subgroup.
Adding Page Logic to Your Survey
To add Page Logic to your survey, follow these steps:
- Click Add Page Logic on the Survey Design page:
- Choose between the three different condition types (questions, quotas, custom fields) or set up an unconditional action.
Question-Based Page Logic
Choosing “Questions” for the condition type allows you to create logic conditions based on responses to questions on the current page or any previous page.
Once you select “Questions”, you will first need to choose which question to base the condition on in the “Respondent answers this question:” column (1). Then choose the operator in the “Where the response is:” column (2) (for more information on logic operators, visit our other help article on the topic), and finally you’ll choose the answer(s) you want to test against (3).
To test more than one logic condition, click “+ Add Condition” and follow the steps for each condition you want to add. Then set the action you would like to happen if the conditions are met, and when you’re happy with the setup, click Save and then Exit to return to the survey design page.
Quota-Based Page Logic
Note: This section demonstrates how to set up page logic based on survey quotas but does not go into detail on setting up or managing the survey quotas themselves. For more information on creating and managing quotas, visit our Survey Quotas help article.
Quota-based page logic allows you to set actions based on survey quotas that you have previously configured. Survey quotas have their own action that is taken when a respondent submits their survey and the quota is met. Page logic actions based on survey quota conditions will be evaluated on the page where the page logic is created.
To provide a real-world example, let’s say that you want to set an overall survey quota of 200 responses, at which point the survey will be closed. At the same time, you want to give a gift card to the first 100 respondents, so you’ve entered a contact info question within your survey so respondents can provide an email address to claim their gift card. You can enter page logic based on the quota such that once the quota has reached 100 respondents, the survey will skip the contact information page, as shown below:
Taking a look at our survey quotas page, you’ll see our “Response Limit” quota is set at 200 while here we’re evaluating the page logic to set an action when total responses reach 100.
Page Logic Based on Custom Field Values
Note: This section demonstrates how to set up page logic based on custom fields but does not go into detail on inserting and using custom fields. For more information, visit our Custom Fields help article.
The third option for creating conditions is basing them on Custom Field values. Custom fields are identifying information about respondents that you attach to their email address in an advanced email list (or attach to a web launch URL). Custom fields are commonly used for including a respondent’s name (for mail merge or otherwise customizing message displays) but they can also be used to enter information such as region, job title, department, etc. You can have up to 5 custom fields per advanced email list and can use them for displaying information to respondents, analyzing response data, setting quotas, or in setting up page logic.
Creating page logic based on custom fields works very similarly to creating page logic based on questions, except that respondents don’t need to answer a question for the condition to be evaluated.
In the example below, let’s say that Custom Field 1 contains a respondent’s region. If a respondent falls within a certain region (Europe in this example), we want to redirect them to complete a different survey altogether.
Unconditional Page Logic
Unconditional page logic allows you to trigger an action without any conditions when the respondent clicks the Next or Submit buttons on that page of your survey. For example, if you need respondents that reach page 3 to be redirected to page 5 of the survey upon clicking Next, then you could insert unconditional page logic on page 3.
A common use for this might be if you are splitting your survey respondents into two groups based on an initial condition or set of conditions (e.g. responses to certain questions or custom field values). Consider the following survey design:
In this example, survey respondents start on page 1 and then based on page logic are split into two groups (a and b), each with their own set of questions (pages 2 and 3 to the survey respondents) before returning to a final set of shared questions (page 4). To respondents this is how the survey would be structured.
To set this up in SurveyMethods, the survey would in reality have the following structure:
All respondents would start on page 1, and the (a) respondents would continue to pages 2 and 3. However, (b) respondents would, based on logic conditions, jump to page 4 and then complete pages 5 and the common page 6. Once the (a) respondents complete page 3 they need to skip the questions on pages 4 and 5 as those are intended for (b) respondents, so you would use unconditional page logic on page 3 to jump all respondents who complete that page directly to page 6.
When you choose Unconditional as your condition type, the “Add conditions” section will be greyed out and you simply need to specify the action to be taken.
- A group cannot contain unconditional page logic along with other condition types (questions, quotas, and custom fields) or subgroups.
- Changing a condition type to unconditional in a group that has other conditions or subgroups will delete the conditions or subgroups.
Viewing and Editing Page Logic
If a page in your survey has page logic, when you are on that page in the Design Survey module, you will see a yellow bar just below the page title that says “Page Logic”:
To see a quick summary of the page logic conditions and actions, simply click on the red down arrow on the right side of the bar. You will then see a list of all page logic conditions and actions, as well as whether they are active or not. You can edit the page logic by clicking the Edit Page Logic button above the page title.
If you want to delete the page logic, you can click the red “X” on the Page Logic bar, or go into Edit Page Logic and deactivate or delete some or all of the page logic groups.
Printing Page Logic
To print a summary of your page logic, simply click the Print button at the top of the Edit Page Logic menu. That will open a printer-friendly version of your page logic.
Clicking Print on that page will open the print dialog box.
Notes and Additional Information
- Related articles and articles referenced above:
- For page logic to be processed, a group needs to be marked as “Active”. By default, when a new group is added the status is set to “Active”.
- You can add as many groups or subgroups as you need. However, a maximum of 5 levels of nesting is allowed within a group.
- A group must contain at least one condition or subgroup.
- No And/Or operator is added between two groups – each group is treated independently and has its own action.
- Each subgroup must have at least one condition.
- The conditions will be evaluated top-down in the order in which the groups appear.
- If there are multiple condition types within groups or subgroups, their evaluation order will be as follows:
|Condition Type||Evaluation Order|
- Important Note:
- If the action specified in a group is panel integration, the conditions in that group will be evaluated first.
- No further conditions in other groups are evaluated after an action is performed.
- Deleting a group or subgroup will also delete any subgroups within it.
- You can move the conditions, groups, or subgroups by clicking and dragging the Move icon on the left side of the item.
- Subgroups can be moved only within the same level.
- Conditions can be moved only within their group or subgroup.
- The “Previous” button will be hidden on any survey page that has page logic based on custom fields.
- Users who have Edit rights on a survey (through survey collaboration) will be unable to add “Redirect to Another Survey” as an action or adjust the redirection if there already is one. They will be able to change the page logic to have a different action. The survey owner will be able to make any and all changes to the page logic actions.
- If the logic action ends the survey or takes the respondent out of the survey, the response status will be marked as “Complete” by default. To mark such responses as “partial”, click Advanced Settings and check the “Set the response status as partial” checkbox.
- A survey cannot be moved to another account if:
- It has page logic with the action “Redirect to Another Survey”.
- It has been used in the “Redirect to Another Survey” action of another survey.
- To move such a survey, you will need to modify the page logic to select an action other than “Redirect to Another Survey”, or delete the page logic.
- If page logic is added on the last page of the survey with the action “Redirect to Another Survey”, “Redirect to Website”, or “Show a Message”, and the survey completion option is also set for the survey, the page logic action gets precedence. In other words, if you select “Set the response status as partial”, the response will be marked as partial even though the respondent submitted the survey. Additionally, if you have a custom completion message it will not be displayed if the page logic triggers one of these actions.
- Editing a question using Full Question Edit or deleting a question will deactivate the page logic groups where this question has been used.
- If you have page logic that skips a page, and there are mandatory questions on the skipped pages, respondents that jump over those questions will not be required to complete them.
- If question-based page logic is set up using negative logic operators like “is exactly not equal to” or “is not equal to any of” on an optional question and a respondent skips the question, the condition will evaluate to “True” and the page logic action will be performed.
- If testing more than one condition, conditions within the same group or subgroup must be of the same type (questions, quotas, custom fields). To test different condition types simultaneously, add a subgroup and use different types in the subgroup.