Note: this section discusses conditions you can use within page logic in SurveyMethods. For a complete overview on creating and managing page logic, visit our help article on Page Logic.
Conditions are the “if” part of the “if…then…” structure of page logic. 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 survey 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 survey for your organization but ask questions relevant to each respondent based on their custom field values.
You can also set up Unconditional page logic. This is discussed further in our Page Logic article. We’ll discuss each of the condition types below.
Question-Based Page Logic
Question-based conditions allow you to create logic conditions based on responses to questions on the current page or any previous page. Once you choose “Questions” as the condition type, you’ll see a dropdown labeled “Respondent answers this question:”.
In the dropdown you will see all of the questions on the current page as well as questions on any previous page in your survey. You can test on any question up to that page because the respondent will have already completed those questions, but you cannot test on later pages because the page logic is executed as soon as the respondent completes the page.
Once you choose the question to test, you will see two more dropdowns, “Where the response is:” and “The following answer:”. The “Where the response is:” prompt is asking how you want to test the respondent’s answer. Your options for this dropdown will vary depending on the type of the question selected in the first column. For example, the question selected below is an Open Ended – Numeric question, so we have options such as greater than, less than, less than or equal to, etc. These options will not make sense for question types with discrete answers such as Choice – One Answer Dropdown Menu (for more information on question types, see our Question Types help article).
Below is the full list of logic operators for question-based conditions, with an explanation of each:
Operator | Description |
---|---|
is exactly equal to | If this operator is used, the condition will be true if the respondent selects ONLY the answer choice or choices that are specified. If one answer is specified, the respondent must choose exactly that answer (e.g. for multi-answer questions they cannot choose that answer AND another answer) for the condition to return true. If more than one answer is specified, the respondent’s answer must match those answer choices exactly. |
is equal to any of | The condition will be true if the respondent selects ANY of the answer choices specified. |
is exactly not equal to | The condition will be true if NONE or ANY (but not ALL) of the answer choices specified are selected by the respondent. |
is not equal to any of | The condition will be true if the respondent selects NONE of the answer choices specified. If you specify several answer choices and the respondent chooses one of them (by itself or along with other answer choices), the condition will return false and the action will not be completed. |
did not provide a response | The condition will be true if the respondent does not provide any response to the question. |
provided any response | The condition will be true if the respondent provides any valid response to the question. Note that if you use fields with validation (e.g. numeric-only fields or an email field), the system will already prevent them from submitting invalid responses. |
contains | The condition will be true if the response contains the specified sequence of characters. |
does not contain | The condition will be true if the response does not contain the specified sequence of characters. |
begins with | The condition will be true if the response begins with the specified sequence of characters. |
ends with | The condition will be true if the response ends with the specified sequence of characters. |
is greater than | The condition will be true if the respondent provides a value that is greater than the value specified. |
is greater than or equal to | The condition will be true if the respondent provides a value that is greater than or equal to the value specified. |
is less than | The condition will be true if the respondent provides a value that is less than the value specified. |
is less than or equal to | The condition will be true if the respondent provides a value that is less than or equal to the value specified. |
Once you select your logic operator, you will either enter the value (for open-ended operators, e.g. “is greater than”, “contains”) or select from the options (for defined operators, e.g. “is exactly equal to”, “is equal to any of”).
Open-ended:
Defined:
As discussed in the Page Logic article, you can test more than one condition simultaneously by clicking the “+ Add Condition” link and repeating these steps. Then you must specify whether you want to test both conditions (And operator) or either condition (Or operator).
In this example, the page logic will return “true” and the action will be taken if either the respondent chooses one of “Under 18” or “19 – 25” on the age question or they specify that they have 0 children on question 2.
Quota-Based Page Logic
Note: This section demonstrates page logic conditions based on survey quotas but does not go into detail on setting up or managing survey quotas. 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.
When you choose “Quotas” as the condition type, you’ll see the following options:
In the first column, you will choose which quota you would like to evaluate based on. If you do not have any quotas set up, there will be no options in the dropdown but you can click the “Click Here to Create Quota” link to set them up.
Once you choose the quota to evaluate, you have various options for testing the condition:
Below is the full list of logic operators for quota-based conditions, with an explanation of each:
Operator | Description |
---|---|
is met | The condition will be true if the quota limit (specified in the quotas menu) has been met. |
is not met | The condition will be true if the quota limit (specified in the quotas menu) has not been met. |
is exactly equal to | The condition will be true if the response count (1) is exactly equal to the value specified. |
is less than | The condition will be true if the response count (1) is less than the value specified. |
is less than or equal to | The condition will be true if the response count (1) is less than or equal to the value specified. |
is greater than | The condition will be true if the response count (1) is greater than the value specified. |
is greater than or equal to | The condition will be true if the response count (1) is greater than or equal to the value specified. |
If you choose “is met” or “is not met”, you do not have to specify a value in the third column, since the quota limit is specified in the quota menu:
For the other logic operators, you will be prompted to enter a value to test against:
Page Logic Based on Custom Field Values
Note: This section demonstrates page logic conditions 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 customization of message displays) but they can also be used to capture 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 your 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.
Since custom fields are by definition open-ended (you will enter or upload the text when setting up or adding to the email list), the operators available for Custom Fields are limited to the open-ended operators available with question-based logic:
Operator | Description |
---|---|
contains | The condition will be true if the respondent’s custom field value contains the specified sequence of characters. |
does not contain | The condition will be true if the respondent’s custom field value does not contain the specified sequence of characters. |
is exactly equal to | The condition will be true if the respondent’s custom field value matches exactly the value specified. |
is exactly not equal to | The condition will be true if the respondent’s custom field value does not exactly match the value specified. |
begins with | The condition will be true if the respondent’s custom field value begins with the specified sequence of characters. |
ends with | The condition will be true if the respondent’s custom field value ends with the specified sequence of characters. |