Page tree
Skip to end of metadata
Go to start of metadata

Advanced Show-Hide feature is used to show or hide questions/answer options based on a logical condition.

 

To set up the conditional display of questions or answer options follow these steps:

  1. Click Advanced features button on the Form/Survey Editing page.
  2. Select Show/Hide from the dropdown.
  3. Click Add Show/Hide button (1) to work in a simple mode or Quick Edit button (2) to work in notepad-like quick mode and add many expressions at once.

 

Simple mode

 Click here for more details:

 When creating/editing one Show/hide action, the page is divided into two sections:

  1. Select questions/answer options to show or hide:

    • Action type
      • Show/hide. This action shows or hides question or answer option when the logical condition is met.
      • Show/hide no clear. This action also shows or hides question or answer option upon logical condition, but does not clear answer value of the displayed question when its visibility changes. Select the option Do not clear existing values to activate this action.
    • Question/Answer options selection
      • Select one or multiple questions by switching between different selection modes. With the help of Allow to select multiple questions option, you are able to show or hide multiple questions or answer options upon the same logical rule, e.g. "Show Q1.A5, Q2, Q3.A1 if Q1.A1".


        Please be aware, that if you worked in Single or Multiple question selection mode, and then decided to work with multiple questions or vice versa, the rule you created earlier will be saved and shown to you once you switch back to the original mode.
      • Reference a range of questions, answer options or columns, using Qx-Qy, Qx.Ay-Az or Qx.Cy-Cz format. For instance, Q1-Q5, Q1.A1-A5, Q1.C2-C7. Ranges of answer options and columns are limited to a single question.
      • The system optimizes overlapping ranges, for example, if the following expression is entered: "Hide Q2.A1-A7, Q3, Q2.A5-A9, Q4 if Q1.A1", the system will optimize it and save: "Hide Q2.A1-A9, Q3-Q4 if Q1.A1".
  2. Condition:

    • You can either create a new condition or select the one created earlier and modify it if necessary;
    • Three conditional operators available: IF, IF NOT and IF ALWAYS. The IF ALWAYS operator triggers an action unconditionally.
    • Build complex logical conditions using Add rule, Add groupAdd sub-group options and AND/OR/AND NOT/OR NOT logical operators.
    • Value for comparison. First, select a condition (Contains, Equals to, etc) and then specify:
      • numeric or text value, i.e. IF Q1.A1=<5;

      • Piping reference[Qx.Ay] or {Qx.Ay} (square or curly brackets), i.e. IF Q1.A1=<[Q2.A1]

        Question and answer identifiers are also supported, so you can use them to reference specific question instead of question/answer option numbers.

      • Piping references on date fields: [Qx.Ay] (square brackets only)

      • Regular expressions

Quick Mode

 Click here for more details:

Quickmode allows to create multiple show/hide expressions at once or copy/paste them fromother sourceinto your form/survey: 

Each expression will appear on a new line on the Quick Edit page:

Please, refer to Advanced Show-Hide#Logic section for more information on creating complex logical conditions.

Summary page

 Click here for more details:

You can add new actions, view, edit and change the priority of existing actions directly from this page. On the Summary page, you can switch between Show/Hide, Branching and Set Values tabs, and each of them is divided into three blocks:

  1. Invalid expressions
  2. Valid expressions
  3. Inactive expressions.
  • If there are multiple expressions set for the same question, they will be executed sequentially. You can change their priority by moving them up or down in a list:

  • To edit an action in Simple mode, click on the logical expression.
  • While working with any action from this page you can disable or delete it. 
  • Quick edit mode is also available for each expression on this page and allows inline editing:

Show-hide logic summary box

 Click here for more details:

If Show-hide logic was applied to a question, then the summary box will be placed right under it stating that this question contains one or multiple Show-hide expressions. You can hover over this box to see a list of expressions:

Show link redirects you to the "Single question" edit page. Show/hide expressions applied to the question are located at the bottom:


+ Add One allows to create a new expression in simple mode and Open Quick Edit redirects to the Quick edit page.


Logic

  When setting up a conditional part of you expressions, you can combine logic conditions using AND, OR and NOT operators as well as group them with parentheses ().

 Logic operators:
  • Operator AND denotes that all the combined logic conditions are met

    Example

    If Q1.A1 AND Q1.A3, meaning if both answer 1 and answer 3 are selected in question 1.

  • Operator OR denotes that at least one of the combined logic conditions is met.

    Example

    If Q1.A1 OR Q1.A3, meaning if either answer 1 or answer 3 is selected in question 1.
  • Operator NOT denotes that a logic condition is not fulfilled. You can put it at the beginning of a logic condition or after AND, OR operators.

    Example

    If NOT Q1.A1, meaning if answer1 is not selected in question 1.
  • You can use AND, OR, NOT operators in the same logic expression simultaneously. Use parentheses to make your logic unambiguous.

    Example

    if (Q1.A1 AND Q1.A3) OR NOT Q2.A3, meaning if either both answer 1 and answer 3 are selected in question 1 or answer 3 is not selected in question 2.
 Valid symbols in logic expressions
Valid symbolsExamples
Letters: Q, A, CQ1, Q1.C4, Q2.A3
Numbers: 1-9, 10 - moreQ9, Q23.A5
Dots: ...Q3.A5.C7
Operators: AND(=&&), OR (=||), NOT (=!)Q3.A1 AND Q3.A3, Q7.A3.C1 OR Q7.A3.C2, NOT Q2.A1
Parentheses: ()(Q1 AND Q3.A2) OR (Q5.A1 AND Q5.A3)

Note: to use complex expressions with double brackets, insert spaces between the brackets:
 ( (Q1 AND Q3.A2) OR (Q5.A1 AND Q5.A3) ) AND (Q6.A2 OR Q6.A3 )
 Logic with question answers:

It is possible to create logic rules based on the answer values comparison of two different questions. You may compare:

Type of comparisonOperatorFormulaExample
fields of general formatequal(s) to, do(es) not equal toQx.Ay==[Qz.At], Qx.Ay<>[Qz.At]Show Q4 if Q1.A1==[Q2.A1]
fields with a date or number formatting applied

equal(s) to, do(es) not equal to
less than, less than or equal to
greater than, greater than or equal to

Qx.Ay==[Qz.At], Qx.Ay<>[Qz.At]
Qx.Ay<[Qz.At], Qx.Ay<=[Qz.At]
Qx.Ay>[Qz.At], Qx.Ay>=[Qz.At]

Show Q6.A3 if Q3.A3==[Q4.A1]
Hide Q10 if Q5.A5<[Q6.A1]
Show Q12 if Q7.A2>=[Q8.A1]

fields with constantsequal(s) to, do(es) not equal to
less than, less than or equal to
greater than, greater than or equal to

Qx.Ay==n, Qx.Ay<>n
Qx.Ay<n, Qx.Ay<=n
Qx.Ay>n, Qx.Ay>=n

HIde Q11.A2 if Q9.A9==20
Show Q17.A3-A7 if Q11.A2<=545
Hide Q20-Q25 if Q15.A4>6

 Logic with text values:

When setting up logical conditions with text responses in the question of these types: Single line text with pre-format options, Multi-line text response, Numeric Allocation, Dropdown fields of the 3D Matrix, Comments field in Pick one with Comments, use the following available operators:

OperatorDescriptionExample
Logic ExpressionResults
==

If text responses contain the exact line string indicated next to '==', then the logic transition is fulfilled.

This operator can also be used to refer to the record within the dropdown box of the '3D Matrix' type of question in the Qx.Ay.Cz==N format, where N is the sequence number of the item within the dropdown box that is selected by the respondent. Please note that enumeration, in this case, starts from 0, so if you need to refer to the 1st answer in the 3D Matrix dropdown, use Qx.Ay.Cz==0 condition; to the 2nd - Qx.Ay.Cz==1 and so on.

Q1.A2==CatFlower
Big Cat
Cathlene
Cat
<>If text responses do not contain the exact line string indicated next to '<>', then the logic transition is fulfilled.Q2.A3<>CatBig Cat
Cathlene
Cat
==LIKEIf text responses contain the line string indicated next to '==LIKE' regardless of its position in the text responses, then the logic transition is fulfilled.Q2.A3==LIKECatCat
Big Cat
Cathlene
Beautiful Flower
<>LIKEIf text responses do not contain the line string indicated next to '<>LIKE' regardless of its position in the text responses, then the logic transition is fulfilled.Q2.A3<>LIKECatCat Flower
Big Cat
Cathlene
Beautiful Flower
==RLIKE

If text responses contain the line string specified by regular expressions next to '==RLIKE' regardless of its position in the text responses, then the logic transition is fulfilled.

==RLIKERed(\s|\w)+CrossRed Bull
Cross Roads
Red fine Cross
<>RLIKEIf text responses do not contain the line string specified by regular expressions next to '<>RLIKE' regardless of its position in the text responses, then the logic transition is fulfilled.<>RLIKERed(\s|\w)+CrossRed Bull
Cross Roads
Red fine Cross
==RMATCHES==RMATCHESxxx is the same as ==RLIKE^xxx$Q1.A1==RMATCHESRed(\s|\w)+CrossRed fine Cross
Red fine Cross only
<>RMATCHES<>RMATCHESxxx is the same as <>RLIKE^xxx$Q1.A1<>RMATCHESRed(\s|\w)+CrossRed fine Cross
Red fine Cross only
  • The Show/Hide functionality can be interactively triggered by responses to questions placed on the same page.
  • When you copy an existing question with Show/Hide logic, logic expressions will not be copied over. However, using quick mode on the Show/Hide page, you may easily copy rules from original question in bulk, paste them and adjust question references.
  • If an answer option is not shown to respondent according to the show/hide logic rule and it was not pre-populated by any platform function(i.e. Autofill, Set value, etc ), it will not be displayed in the report by respondent unless 'Do not clear existing values' option is checked.
  • In case if Piping is applied to a field with a Hide if Always condition, the hidden data will be stored even without 'Do not clear existing values' option.

Example

For example, if the following show/hide conditions are set on the form:

  • Show Q3.A1 if Q2.A1.C5
  • Show Q3.A2 if Q2.A2.C5
  • Show Q3.A3 if Q2.A3.C5

it will function the following way: