Logics

Logics

5. Logics

Logic Types Overview

The Logic Types Overview page introduces the logic options available in SurveyHub for creating interactive surveys. These logic types determine how the survey behaves based on respondents’ answers and allow you to design dynamic, responsive survey flows. Multiple logic types can be applied within a single survey, with each logic performing a specific and predefined function. 


How Survey Logic Works

Survey logic defines the path respondents follow based on their answer choices. When a respondent’s selection meets the predefined criteria, the corresponding logic is triggered and automatically directs them to the appropriate next step in the survey.

Some logic types require a Criteria to be defined, which you can create either in advance or while applying the logic during survey setup.

5.1 Skip Logic

Use Skip Logic to direct respondents to a different page or set of questions based on the answer they select. You can assign a unique skip path to each answer choice.

Example: In a single-choice question with three options, Skip Logic allows you to create three distinct survey paths, guiding respondents to different points in the survey based on their selection.

Step 1: Navigate to the question you want to apply logic to, and then click the Logic button on the right side of the question.

Step 2: Select Skip logic to configure question paths based on respondents’ answers.



Step 3: Configure question branching by specifying the page or set of questions respondents should be directed to for each answer choice. Assign a destination for every option to create a customized survey path tailored to respondents’ selections. Once it is configured, click Apply



5.2 Delayed Branching


Use Delayed Branching to create a branch of questions that respondents are directed based on a specific criteria. This allows you to design question paths that depend on answer choices from previous questions, creating separate branches for each option.

How it works: 

While Skip Logic directs respondents to a specific question for each answer choice, Delayed Branching works like an “if-else” condition. Delayed Branching is triggered only when the defined criteria are met, whereas Skip Logic does not require criteria to function.

Step 1: Select Delayed Branching to apply logic to your survey questions.

Step 2: To add a criteria, select either Use Existing or click Create Criteria to define a new one from the drop-down list. Specify the question that requires branching and the answer choices that will trigger the branch.

Step 3: Select where respondents should go if the criteria are met.

Step 4: Add additional conditions (optional). Click + Add Criteria to add more branching conditions. Assign criteria for the new condition.

Step 5: Specify a default logic if in case no criteria is met. Select a question for the Default Logic.

Step 6: Click Apply to save the changes.

NOTE: You can add multiple criteria and branching conditions by clicking +Add Criteria. Place each branched question on a different page to maintain a proper logic path.


5.3 Question Display Logic

Question Display Logic is used when you want the respondents to see a particular question only if the selected criteria are met. If the criteria are not met, the question is not visible to the respondent. This is used when the second question is to be shown only if the user has selected a particular answer choice in a previous question. 

This is different from skip logic and delayed branching in the sense that it is used to either hide or show one question whereas, the other two help create a logic path for the survey. You can either choose to show or hide a question based on criteria using Question Display Logic.

Step 1: Go to the question you want to display if the criteria are met.

Step 2: Select the Logic button on the right side of the question.

Step 3: Click Question Display Logic

Step 4: Select Criteria or create one by clicking Create New. In this case, the criteria involves selecting a previous question which decides whether the current question is visible or not. Select the option that needs to be selected to activate Question Display Logic. 

Step 5: Click Apply.

NOTE: Make sure the question you are applying for the Question Display logic on is on a different page to ensure a proper logic path.


5.4 Options Display Logic

Options Display Logic is used when you want the respondents to see a particular set of options for a question only if the certain criteria are met. If the criteria are not met, those options will not be shown to the respondent. This is useful when the options for a subsequent question should appear only if the respondent has selected a specific answer in a previous question.This is different from skip logic and delayed branching because it is used to  show or hide or show options, whereas the other two  create a logic path for the survey.

Step 1: Go to the question you want to display if the criteria are met.  

Step 2: Select the Logic button on the right side of the question.

Step 3: Click Options Display Logic.

Step 4: Select Criteria or create one by clicking Create New. In this case, the criteria involve selecting the question that determines whether the current options will be visible.” Select the option that needs to be selected to activate Options Display Logic. 

Step 5: Click Apply.

NOTE: Make sure the question you are applying for the Options Display logic on is on a different page to ensure a proper logic path.


5.5 Carry Forward Choices

Use Carry Forward Choices to transfer the options from one question to another. You can carry forward all answer choices or only the selected/unselected ones. This feature is applicable to choice-based questions, such as Multiple Choice, Dropdown, Ranking, or Rating questions.

Step 1: Select Carry Forward Logic from the Logic Settings window. 

Step 2: Fill in the required fields:  

  1. In the From field, search for and select the question whose answer choices you want to carry forward.

  1. In the Carry field, select the answer choices you want to carry to the current question. You have the following options:
  • All choices displayed & hidden: This option carries all the option choices from the question.
  • Displayed Choices: This carries all the displayed choices.
  • Hidden Choices: This carries all the hidden choices if any.
  • Selected Choices: This carries only the selected choices from the question you want to carry the choices from.
  • Unselected Choices: This carries the choices not selected.
  • All Display choices before Selected: This carries the choices from the first on the list to the selected choice.
  • All Display choices after selected: This carries all the displayed choices after the selected choice in the list to the end of the list.

  1. In the Excluding field, select any choices you do not want to carry forward (optional).

  1. Check any applicable settings for carried choices: Carry Codes, Carry At Top, or Carry As Plain Text (optional). 
  • Carry Codes – carry the codes associated with the choices.
  • Carry At Top – display carried choices at the top.
  • Carry As Plain Text – display choices as plain text.

  1. Check Maximum Allowed Options if you want to restrict the number of answer choices that can be selected (optional).
  2. Click Apply to save the Carry Forward Logic settings or Reset to clear the selections and start over.


NOTE: Make sure the two questions are on two different pages to ensure a proper logic path.


5.6 Embedded Data Logic

Use Embedded Data logic to identify the respondents and calculate certain scores based on their information. 

Step 1: Select Embedded Data from the Logic Settings window. 

Step 2: Select Criteria or create one by clicking Create New. In this case, the criteria involve selecting the question that will decide the value to be set for the Embedded Data. 

Step 3: Enter the name of the variable and select variable type. The variable can be Embedded DataContact DataManual or Equation based values.

Step 4: If you wish to set multiple values based on a single criteria, you can click Add Variable to assign another value to a variable.

Step 5: For adding another criteria for embedded data value assignment, you may click + Add Criteria.

 

Step 6: Click Apply to save the Embedded Data logic.

5.7 Custom Logic

Custom logic is used when you want to implement your own custom logic to your survey question. This allows you to customize how the logic functions, from pre logic to post logic results.

A custom logic can be comprised of multiple logics that are available on the SurveyHub platform.

Step 1: Navigate to the question on which you want to apply Custom Logic.

Step 2: Select the logic button on the right-hand side of the question.

Step 3: Click Custom Logic.

Step 4: Create a Pre Logic and Post Logic code snippet for the Custom Logic to be triggered. A pre logic statement is used to configure whether the post logic statement should be triggered or not.

NOTE: You can click the “See all Functions” to view all the functions that can be
    used to code your Pre Logic and Post Logic statements.

Step 5: Click Save.

Types of Functions

PRE LOGIC FUNCTIONS

  • isAnswerSelected() – Function that determines whether a particular answer choice was selected by the respondent.
  • getSelectedOptions() – Function that fetches all the selected options from the question on which logic is applied.
  • getSelectedOptionsIndex() – Function that fetches all the indexes of the selected options from the question on which logic is applied.

POST LOGIC FUNCTIONS

  • branchToQuestion() – Function that branches the survey flow to another question as specified in the function.
  • disqualify() – Function that disqualifies the respondent from taking the survey and takes them to the Disqualification screen.
  • hideQuestion() – Function that hides a specific question or set of questions from the respondent.
  • hideOptions() – Function that hides specific options of a question to the respondent.
  • endSurvey() – Functions that redirects the respondent to the End Survey screen, restricting the respondent from answering any additional questions.
  • setOptionsSelected() – Function that automatically selects a set of options of a particular question.
  • showOptions() – Function that shows specific options of a question to the respondent.
  • updatedCustomVariable() – Function that updates the value of a custom variable that is configured via the Variables section.


5.8 Priority Logic

To set the priority of specific answer choices, use Priority Logic. You can reorder options for each respondent, either based on criteria or without any. This is useful when there are many choices and you want to highlight certain options. You can also create criteria, so the logic applies only when they are met.

Example: In a survey, you might want one priority list for users who are mobile-friendly and a different list for users who are laptop-friendly. You can do this by creating a first condition with its criteria and priority list, then adding a second condition in the + Add Criteria section with its criteria and priority list. Finally, add a priority list for the condition.

The logic path will then follow this sequence: start with the first condition, proceed to second criteria if the first condition is not met, and end with the final condition.

Step 1: Select Priority Logic from the Logic Settings window. 

Step 2: Select Criteria or create one by clicking Create New. In this case, the criteria involves selecting the question that will decide the priority of the options for the question to which the Priority logic is being applied.

Step 3: Once criteria is created, click Search Priority List to configure the priority.

Step 4: Create a new Priority List and add options it to from the current question by clicking icon. The options must be added in the order of their priority.

Step 5: Click the Save List button to save the list.

Step 6: In case you wish to add more criterias on the basis of which the priority of options should be modified, click + Add Criteria to configure another criteria.

Step 7: Once all criteria are defined along with their priority list, click Apply to save the Priority logic.


5.9 Auto Select Logic

To automatically save a specific set of answer choices, use Auto Save Logic. You can apply it with or without criteria. If criteria are used, the logic activates only when the conditions are met. Without criteria, Auto Save Logic will, by default, select the answer choices you marked when creating the logic.


Step 1: Select Auto Select Options from the Logic Settings window. 

Step 2: Select between Simple or Conditional Auto Select Logic if you wish to configure auto select logic based on criteria or no criteria. 

Step 3: Select the answer choices that are to be automatically saved.

Step 4: If you wish to prevent the respondent from selecting options apart from the auto-selected ones, enable the Read Only Mode toggle.

Step 5: Click Apply to save changes. 

NOTE: When using Conditional Auto Select Logic, you may configure additional criteria based on which auto select logic should work by clicking the + Add Criteria button. 

Alternatively, you can specify a default path for when no criteria met by configuring the By default, auto select these options dropdown.


5.11 Promoter Amplification

Promoter Amplification is a feature designed to leverage your most satisfied customers by instantly displaying a customizable Call-to-Action (CTA). This CTA prompts the user to share their positive experience with your brand on various social media channels.

This action is triggered when a respondent answers a Net Promoter Score (NPS) question and selects a score that qualifies them as a Promoter (a score of 9 or 10). This functionality instantly converts high NPS scores into brand advocacy and positive word-of-mouth marketing.

Step 1: Create an NPS question or select from an existing NPS question.

Step 2: Click the Logic Button.

Step 3: Select Promoter Amplification.

Step 4: Select the social media channel on which you want your respondent to provide feedback for your brand, product, or service. 

Click the + icon to expand the configuration menu for that channel.

NOTE: Please note that SurveyHub currently support Facebook, X (formerly Twitter), LinkedIn, WhatsApp, and Google social media channels.

Step 5: Configure the following required fields to add the social media channel to your promotional message:

  • Link to Share: This is the URL that will be embedded within the respondent's post or message. This should be a link to your product, service, or brand website.
  • Message / Quote Shared: Enter a custom message that will automatically populate the new post. This acts as a boilerplate that the respondent can easily modify before sharing the promotional content.
  • Questions Shared: Select the response from a specific survey question to be dynamically included with the promotional post (e.g., a specific positive comment the user provided).
  • Hashtags to be Shared: Enter the hashtags (e.g., your brand or campaign hashtags) that will be automatically included with the respondent's post.

Step 6: Enter a personalized message that should appear along with your promotional card and Call-to-Action on the survey screen.

Step 7: Click Apply and Publish your survey to save and activate the changes.

5.12 Deleting A Logic

To remove a logic, delete any applied logic from a question.

Step 1: Click the label that shows the applied logic in a question. In this case, the label shows Skip Logic. 



Step 2: In the Logic Settings window on the right, click the three-dot menu next to the applied logic and select Delete.

Step 3: Once you click delete, you will see the pop window to confirm the deletion. Select Yes to continue deleting. 


    • Related Articles

    • Guide to Creating Surveys

      2. Guide to Creating Surveys 2.1 Creating a New Survey To create a new survey, click the Create Survey button on the top right corner of your account page. 2.1.1 Start from Scratch Select Start From Scratch to initiate the creation of a new survey ...
    • Survey Customization

      6. Survey Customization Once your survey is ready with all questions and logic, the next step is to enhance its appearance using the available theme options and apply advanced survey settings wherever applicable. 6.1 Themes Customize your survey’s ...
    • 07 7 Survey Settings

      7. Survey Settings 7.1 Basic Settings The following settings are present under the basic settings tab: General, Languages, Quality Checks, Security, Completion Rule and Analytics. 7.1.1 Languages Language feature in SurveyHub’s survey creation allows ...