Skip to content

How do I show or hide an interaction with conditional logic?

Conditional logic shows or hides an interaction based on a variable, such as an earlier answer. Set it in Variables & Logic. Available on Pro and higher.

Updated

Short answer

Conditional logic shows or hides one interaction based on the value of a variable. Open the interaction, go to Variables & Logic, turn on Conditional Logic, and set a rule such as Show if company_size Is a number greater than 100. Conditional logic is on Pro and higher plans.

How to do it

  1. Set the variable first. For example, ask “How many people work at your company?” and store the answer in the variable company_size.
  2. Open the interaction that should appear or disappear.
  3. Open Variables & Logic and turn on Conditional Logic. On a question, open the Conditional Logic section.
  4. Choose Show if or Hide if.
  5. Choose the variable, choose the condition, and enter the value to compare.
  6. To test two variables, turn on Add Second Condition and choose AND or OR.
  7. Save, then test in Preview with each value you expect.
Variables & Logic section of a Mindstamp button with Conditional Logic on and the rule Show if interest Equals pricing
Turn on Conditional Logic, then build the rule: Show if, a variable, a comparison and a value.
Mindstamp Conditional Logic with Add Second Condition turned on, the join operator set to AND, and fields for the second rule
Turn on Add Second Condition, join the rules with AND or OR, then set the second rule.

Conditions you can use

  • Equals and Does not equal
  • Exists and Does not exist
  • Is a number less than and Is a number greater than
  • Contains and Does not contain
  • Matches Regex

Example: one offer for each company size

You have three buttons: Small company offers, Medium company offers, and Large company offers. Each one gets its own rule:

  • Small: Show if company_size Is a number less than 10.
  • Medium: Show if company_size Is a number greater than 9 AND company_size Is a number less than 100.
  • Large: Show if company_size Is a number greater than 99.

How values are compared

  • Equals and Contains ignore capital letters, so “Manager” matches “manager”. Spaces still count.
  • Number conditions are true only when both values are numbers. “Less than” and “greater than” do not include the value itself.
  • Exists is true when the variable has any value.
  • An interaction can use two conditions at most.
  • The player checks the rules again each time a variable changes, so an interaction can appear as soon as the viewer answers.

Test in Preview, not in the editor

The editor shows every interaction, and it does not set variables. Open Preview to see the video as a viewer does. To test a value quickly, add it to the share link, for example ?company_size=50.

Plan

Conditional logic is on Pro and higher plans. The variables it reads are on Core and higher. The 14-day free trial includes both, so you can build and test before you choose a plan.

Go further

Support

Still need an answer?

Send the video link and what you see, and the Mindstamp team will help.

New to Mindstamp? Start Free Trial.