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.


  1. Basic steps to add a Visible If condition
  2. Definitions of evaluation choices
  3. An example of multiple "Visible IF" conditions
  4. Checkbox "Visible IF" instructions
  5. Recognizing an error in the logic conditions


Basic steps to add a Visible If condition



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



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.



  • 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



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 to 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 only 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 en 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. 




(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"

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

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


(top)


Recognizing an error in the logic conditions


If there is an error in the logic conditions, you will notice the "ADD" button in the dialogue changed to a "REPLACE" button.  Errors are typically created by manual adjustment to the logic conditions for a particular question's "Visible If" properties - but can occur in rare circumstances when using the logic creation dialogue.  The "REPLACE" button that indicates an error is also paired with a small red x symbol, as seen below:


Errors will typically involve typos or missing characters such as a missing quotation mark, a missing curly brace/bracket, or an incorrect value.  In the example above the initial quotation mark is missing from "Strong Support."

If you add a new logic statement while the "REPLACE" button is appearing, all your current logic content will be fully replaced.  As with many user interfaces, you can use cmd/ctrl-Z to undo changes and restore the former content.

(top)