Multiple Conditions in a form rule using Multi Line text

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
I have a multi line text field 'Workout' with 3 values 'Running', 'Biking' and 'Weight Lifting' , I am trying to use dynamic rules in a way that when Running or Biking are selected from the multi line text, 2 fields 'Distance' and 'Time' should be displayed on form and when 'Weight Lifting' is selected they are hidden and other 3 fields are displayed. I can't put both the biking and running conditions in rules as they contradict each other when formed as separate rules. Can anyone help with the solution? attached is the picture.
Photo of Raj Helaiya

Raj Helaiya

  • 1,246 Points 1k badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of Chuck Grigsby

Chuck Grigsby

  • 1,978 Points 1k badge 2x thumb
Choose, is equal to "the value.." then in the box put Biking OR Running
Photo of Raj Helaiya

Raj Helaiya

  • 1,196 Points 1k badge 2x thumb
Well, it contradicts other rules. When I select is equal to the value of biking or running then show distance and time . But when I need to select weight lifting distance and time need to be hidden and other fields such as reps and weight in pounds need to be displayed. I suppose I have conflicting rules on same field Distance and TIme. 
Photo of Chuck Grigsby

Chuck Grigsby

  • 1,978 Points 1k badge 2x thumb
You can have different tiers of rules in a single form rule. Can you consolidate at all?
Photo of Raj Helaiya

Raj Helaiya

  • 1,196 Points 1k badge 2x thumb
Yes, but when consolidating all conditions one remains. Distance and Time are shown initially in the form which is not intended. See attached. 
Photo of Michael Barrow

Michael Barrow

  • 2,206 Points 2k badge 2x thumb
I think what you need to do here is create some formula checkbox fields that are used to drive the display logic. That way, the logic in the form rules for what to display will be much simpler, and you have a layer to hide that complexity. have a [Display xxxxx?] field for each field that you need logic to show or hide on your form. Set up an If statement in your formula for each to encode your business logic for whether or not to show or display it, based on the selections in the other field(s). Then set up a dynamic form rule for each Display formula checkbox field in the when part and show or hide that field accordingly in the Action part. That way, you won't be setting up multiple dynamic form rules that contradict each other when more than one refers to the same field. The only limitation here is that you can't have more than 20 dynamic form rules per form.
Photo of Raj Helaiya

Raj Helaiya

  • 1,196 Points 1k badge 2x thumb
Thanks Michael, it worked this time but having a formula is an important feature if there are multiple rules.
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
Create a rule that has "Multiple Conditions are true" and make it "any"
then make the two conditions with the logic for when its running OR biking, it shows the desired fields.

Then same logic will apply for weights to 'show' the reps, sets, exercise, weight in pounds.
Photo of John Thomas

John Thomas

  • 1,062 Points 1k badge 2x thumb



I hope this will solve your issue !!!
Photo of Raj Helaiya

Raj Helaiya

  • 1,196 Points 1k badge 2x thumb
Thank you. Yes, combining multiple conditions with other rules, I achieved the desired display of fields.