Skip to main content

Create conditional logic in your surveys

You can trigger specific actions based on the values provided by your visitors when they interact with your survey. Conditional logic allows you to show or hide survey elements or screens depending on each user’s input.

Show or hide an element based on a visitor's survey response

You can configure elements or screens to appear (or disappear) based on what users select or type in your survey elements. For example, if a visitor selects a specific answer in a multiple choice question, a Long Answer field may appear to ask for more details.

To do this, you create:

  • Element 1, visible by default.
  • Element 2, hidden by default.
  • A conditional rule in the Events section to display Element 2 if a specific value is selected in Element 1.

Example use case

Suppose you've built a multi-step NPS survey and want to customize the experience based on the user's score. For example, if a user give a score from 0 to 6 (a Detractor), you might want to display a follow-up question asking for more feedback. If the score is 7 to 10 (a Passive or Promoter), you can skip straight to a thank-you message.

In the following example, the survey consists of two screens:

  • Screen 1: The NPS score question (0-10).
  • Screen 1 (Detractors only): An open text field asking for the main reason behind the score.
  • Screen 2: A confirmation screen ("Thank you for your feedback!).

Step 1: Set up your survey screens

In the Widget Studio, create both screens:

  • Screen 1 with the NPS element
  • Screen 2 with a confirmation message

Screen 1

Screen 2

Ensure Screen 1 is the default screen.

Step 2: Ask a follow-up question to Detractors

  1. Select the NPS element.
  2. In the Settings tab, under Follow-up question, select Detractors

Step 3: Add a conditional logic event for Passives and Promoters

  1. Go to the Events panel and click Add event.
  2. Select Survey/Form as the trigger.

  1. Choose By element survey/form value.

  1. Click Select an element > NPS.
  2. Under Selected value, choose Passives and Promoters.

  1. Then, define the action. Click Add action > Show element.

  1. Select Thank you screen.

  1. Define a second action: Hide element > Screen 1.

This setup means that Screen 2 will appear if the visitor selects a score between 7 and 10, ensuring a smooth transition from feedback to the thank-you screen.

Step 4: Simulate your widget

Here's what the final logic looks like:

  1. Screen 1 is always shown first.
  2. If the score is between 0 and 6, the follow-up question is shown.
  3. When the visitor clicks Submit on Screen 1, they reach Screen 2.
  4. For scores of 7 and higher, the follow-up question is skipped and users go straight to Screen 2.

This logic helps you gather more detailed insights from detractors while keeping the experience frictionless for other users.