2

I'm using Sitecore 9.1 forms. I have a drop down and couple of sections of the form. Based on drop down value, i want to show/hide the sections. Below is my form and the conditions.

When i select one the form doesn't show any section.

However when i select two or empty, it works fine. Any idea how to resolve this?

enter image description here

enter image description here

Output looks like this

1 Answer 1

4

I have tried messing around with the conditions, and I am concluding that the Sitecore Forms conditional logic is weird.

1. Logic

The conditional logic seems to be based on the following

  1. All Condition are evaluated and applied in sequence.
  2. Foreach condition, if the Condition matches, then apply selected action. Else, apply inverse of selected action.

2. Example

2.1. Setting

To explain how it works, lets use your scenario. For your scenario, it can work with the following setting Condition

2.2. Explanation

2.2.1. Dropdown Selection: Empty

  • Condition 1 Evaluation = False. Inverse selected action (Hide section1 and section2)
  • Condition 2 Evaluation = True. Apply selected action (Hide section1)

Results: Hide both section1 and section2

2.2.2. Dropdown Selection: 1

  • Condition 1 Evaluation = False. Inverse selected action (Hide section1 and section2)
  • Condition 2 Evaluation = False. Inverse selected action (Show section1)

Results: Show section1 and hide section2

2.2.3. Dropdown Selection: 2

  • Condition 1 Evaluation = True. Apply selected action (Show section1 and section2)
  • Condition 2 Evaluation = False. Inverse selected action (Show section1)

Results: Show both section1 and section2

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.