Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Application Server

Example 2: Complex visibility expressions

  • Last UpdatedDec 17, 2024
  • 2 minute read

Setting more complex rules for the visibility of Choices and Options requires the use of the logical operators AND, OR, or NOT, and may also necessitate the use of parentheses to ensure that the expression is parsed correctly. The rules for using logical operators are listed in Operators, rules, and behavior for visibility expressions.

Scenario 1: Visibility of option is contingent on specific choices

Consider the following scenario. We want to allow a user to select Option #1 only when Choice #1 or Choice #3 is selected from Group #1.

Entering parameters for a complex visibility expression

  1. Select Option #1 and type [ (open bracket) in the Visibility text box.

  2. Select Group #1::Choice #1 from the drop-down list.

  3. Place the cursor in the text box after ] (close bracket) and type OR.

  4. Type [ and select Group #1::Choice #3 from the drop-down list. The Visibility text box should contain:

    [Group #1::Choice #1] or [Group #1::Choice #3]

  5. Select Test mode.

  6. Select Group #1::Choice #1. Option #1 is visible

  7. Switch to Group #1::Choice #3. Option #1 remains visible.

  8. Switch to Group #1::Choice #2. Option #1 is now hidden.

Scenario 2: Visibility of option is contingent on a combination of choices and options

In this case, we want allow a user to select Option #3 only when Group#1::Choice #1 and Group#2::Choice #1 or Group#2::Choice #2 is selected and Option #2 is true. This expression can be interpreted in different ways:

  • (Group#1::Choice #1 and Group#2::Choice #1) or (Group#2::Choice #2 and Option #2::True)

  • Group#1::Choice #1 and (Group#2::Choice #1 or Group#2::Choice #2) and Option #2::True

Let's assume that we want the latter interpretation.

  1. Select Option #3 and type [ (open bracket) in the Visibility text box.

  2. Select Group #1::Choice #1 from the drop-down list.

  3. Place the cursor in the text box after ] (close bracket) and type AND.

  4. Type [ and select Group #2::Choice #1 from the drop-down list.

  5. Place the cursor in the text box after ] (close bracket) and type OR.

  6. Type [ and select Group #2::Choice #2 from the drop-down list.

  7. Place the cursor in the text box after ] (close bracket) and type AND.

  8. Type [ and select Option #2 from the drop-down list.

  9. Position the cursor in the text box enclose Group#2::Choice #1 or Group#2::Choice #2 in parentheses.

  10. The Visibility text box should contain:

    Group#1::Choice #1 and (Group#2::Choice #1 or Group#2::Choice #2) and Option #2::True

  11. Select Test mode.

  12. Select Group #1::Choice #1. and Group#2::Choice #1. Option #3 is hidden.

  13. Set Option #2 to True. Option #3 is now visible.

    Testing a complex visibility expression

    TitleResults for “How to create a CRG?”Also Available in