Skip to main content
Nintex Community Menu Bar

Form Rule Help hiding panel with OR combinations

  • April 8, 2019
  • 7 replies
  • 25 views

Forum|alt.badge.img+1

Hello all.  Been banging my head against a wall and would greatly appreciate any assistance.  I have a form panel that needs to be hidden with a variety of AND and OR.  

 

Fields:

QuantityNamedControl = Number column

UnknownQuantityNamedControl = Yes/No named control not connected to a column

ChoiceNamedControl = Choice column

 

I need to only show the panel in the following conditions:

1) QuantityNamedControl is greater than 42

2) UnknownQuantityNamedControl is checked

3) QuantityNamedControl is greater than 4 AND ChoiceNamedControl is Yes

 

Rule I've tried:  Hide when

or(lessThan(QuantityNamedControl,42),not(UnknownQuantityNamedControl),and(lessThan(QuantityNamedControl,4),!equals(ChoiceNamedControl,'Yes')))

 

I've also tried this using && and ||, all with very strange behavior.  The OR seems to be behaving as an AND, and the AND at the end containing the choice doesn't work at all.  Thanks in advance for any input.

7 replies

Forum|alt.badge.img+10
  • April 8, 2019
Hope I got your rules correct, Hide the control with following conditions

QuantityNamedControl < 42 || !UnknownQuantityNamedControl || ( QuantityNamedControl < 4 && ChoiceNamedControl !="Yes")

Forum|alt.badge.img+1

Thank you for your reply.  I tried what you provided and it still won't work.  I've never seen this before, but if I even put only the first two conditions, it's treating the OR as an AND.  If I switch the || to &&, then it behaves as an OR and the first two conditions work.  Have you ever experienced this? 


Forum|alt.badge.img+1

I tried some completely different rule comibnations and can conclusively say that the || is behaving as AND and the && as OR. Literally never seen this. 


Forum|alt.badge.img+10
  • April 9, 2019
Strange, which form version do you have , did you try individual rules, are they working as expected.

Forum|alt.badge.img+14
  • Scholar
  • April 10, 2019
I need to only show the panel in the following conditions:

formating rule's logic is to HIDE a control when its formula evaluates to true.

 

so if you want to SHOW a control if  (eg.) amount > 42, then you have write a rule's formula with oposite logic so that HIDES the control when amount <= 42.

 

similarly for AND/OR-ing expressions, if control should SHOW if A OR B is true, then the formula has to HIDE the control when not(A OR B) is true.

 

that's likely what confuses you in regard of AND/OR functionality.

 


Forum|alt.badge.img+1

You're 100% right, emha.  That was the logic mistake I was making, so thank you. 

 

This leaves me with one last challenge.  I can't use the javascript approach of && or || due to needing a mobile layout as well, which leaves me with using nested OR/AND functions.  Are there any good examples of nested conditional statements out there for 3 conditions?  The third of which would also contain an AND.  None of my initial attempts have worked so far.  Thanks, cheers, and regards!


Forum|alt.badge.img+14
  • Scholar
  • April 11, 2019

if you already have a formula with javascript operators, conversion to runtime functions should be pretty simple:

 

A || B will become or(A,B)

A && B will become and(A,B)

etc.