Understanding Question Branching using "Visible If"

Visible if branching example

Visible If lets you add conditions to control which additional questions appear in the script, based on the responses to previous questions (i.e. they are Visible only if a certain answer is selected). All question branching is based on using Visible If conditions.


TABLE OF CONTENTS


Basic steps to add a Visible If condition

Adding Visible If Conditions

You must name your question before you set up Visible If conditions based on that question. Script variables with a single set of curly brackets (i.e. {when_vote} below) are referencing the question name of a previous question. If you change a question name after setting up your Visible If conditions, you will need to update any Visible If conditions that were referencing the old question name. 


In the Visible If tab in the question editor, use the following steps to create a new Visible If condition:

  1. Select a question. The question selected and the choices for that question will display below the logic options.
  2. Choose how the question should be evaluated (like equal to, less than, etc) by choosing from the drop-downs.
  3. Click on an answer to finish building the logic string.
  4. Note the text below the question - this is the current Visible If statement as it stands before you apply your new logic. 
  5. Click the ADD button to see the updated Visible If condition you have created.
  6. Repeat steps 1-5 if needed. Click "OK" when done

adding multiple conditions

NOTE: You can have multiple Visible If conditions joined by “or” or “and” statements. The drop-down only lets you add conditions with an “and”, so you will need to type an adjustment to use “or” -- just add two different arguments then replace the “and” between two arguments with an “or” instead.


You can manually adjust the new Visible If statement text by typing directly into the string.

typing in the visible if condition

  • Tip: The template question sets have Visible If logic set up internally for you, so the multiple questions in the templates are already linked. The entire question group can be triggered by connecting the first question in the template to a previous answer’s value.


(top)


Definitions of evaluation choices

Evaluation choices

There are several ways to evaluate the answer values:



is empty

The question is Visible If ... the question does not have any response. 


  • Used less often as its counterpart "is not empty". 
  • This condition means a question would be visible when the script is loaded and would disappear when a certain question is answered.


is not empty

The question is Visible If ... any answer is selected from the question. 


  • This is the main way to chain a script question after another one if the script does not change based on the previous answer
  • Example: a yard sign ask that follows a volunteer ask


equals

The question is Visible If ... the response matches exactly the selected response. 


  • This is the main way to chain a question if you only want to ask certain targets
  • Example: a volunteer question that  is shown to targets who are strong supporters


not equals

The question is Visible If ... the response must not match the selected question response.  


  • This option is good for excluding a single response from a new pathway
  • Should be used in combination with an "is not empty" condition to ensure the question does not show up on script load.
  • Example: removing already voted targets from a GOTV path 


contains

The question is Visible If ... the response includes the text you specify. 


  • Can be used to parse free-text responses.


not contains

The question is Visible If ... the response does not include the text you specify - if that string of text is present in the response the pathway will not proceed.  


  • Used similarly to "not equals," this option can exclude a selected response from moving to the selected question. 
  • Can be used to parse free-text responses.


greater, less, greater or equals, less or equals

The question is Visible If ... the question answer matches the selected math operation. 


  • All apply only to numerical answer choices 
  • Can be used in combination with ranking type questions to split out responses
  • Example: different GOTV paths based on how likely a target is to vote as used in the GOTV question template 


(top)


An example of multiple Visible IF conditions


If you use the contact widget, you will want to add a question or ending after the contact widget. Your Visible If condition should contain: 


  1. the "equals" evaluation when a caller selects "No" for the question asking whether someone wants to be contacted to move on with the script without showing the rest of the contact widget.  
  2. the "is not empty" evaluation to show your next question after someone enters an email or cell number in the contact widget.  


You can cover both scenarios in one set of conditions as follows:


{can_contact} = "No" 
or {contact_email} notempty
or {contact_text} notempty


  • {can_contact} = "No" covers when someone doesn't want to be contacted
  • {contact_email} notempty covers when someone enters an email address
  • {contact_text} notempty covers when someone enters a cell number to text


This Visible If condition would be in the question you want to show following the contact widget, not within any question in the contact widget itself. 

multiple visible if conditions

(top)


Checkbox Visible IF instructions


To set up Visible If conditions based on checkbox answers, use the "contains" keyword option. You can access this in the dropdown for adding Visible If conditions, or add it in the text area.


Examples:

  • Make the question visible if these answers are all selected
    • {question1} contains "item1" and {question1} contains "item2" and {question1} contains "item3"

the and operator

  • Make the question visible if some of the checkboxes are selected using "or":
    • {question1} contains "item1" or {question1} contains "item2"

the or operator

  • You can also use the "notempty" condition if you want to show the question if any of the checkboxes are selected:
    • {question1} notempty

not empty

(top)