Skip to main content

The condition that will mark the control as invalid and prevent the form from being submitted if the condition expression evaluates to TRUE. If the expression evaluates to FALSE, the rule will not be triggered. The formula builder button (to the right of the Condition field) can be used to aid construction of condition formulas. The form will not be submitted if the validation rule evaluates to TRUE.

To use an expression that needs an operator, use from the following:

String literals must be contained in double quotes (e.g. Option=="High").

== is equal to

=== is exactly equal to (value and type)

!= is not equal

!== is not equal (neither value or type)

> is greater than

< is less than

>= is greater than or equal to

<= is less than or equal to

&& and

| | or

! not

Use the {Self} variable (available in the Named Controls tab in the Formula Builder) to reference the value in control associated to a rule within a condition

If comparing two date controls you can (DateControl1 <= DateControl2) this is to mean that DateControl1 must be greater in order to be valid and allow submit.

Andrew,

Can't say how valuable this post has been.  Thanks for putting it together. I've referenced it in at least 3 answers so far.  happy.png


I agree with Eric Harris​, this has been incredibly valuable.  Thank you Andrew Glasser​ for adding this to the community! 


There can be issues with Nintex Mobile when using these operators. Please check this post: https://community.nintex.com/community/tech-blog/blog/2016/09/06/nintex-mobile-runtime-rules-work-on-android-but-not-on-ios-windows-or-windows-Phone

I therefor advice to use the default runtime functions where possible.

Cheers,

Rick


How can a flag a numerical value that is out of range and prompt and additional response within the form?  For example, the value for a particular response should be between 7.7 – 8.3. If it’s not, I need the person to enter a corrective action.  I can’t figure out how to write the expression.


Try (ValueControl < 7.7) && (ValueControl > 8.3). Then this means the validation rule is invalid if not between 7.7 and 8.3 inclusive. When invalid, the user will be alerted to the issue and cannot submit.


Thank you. A caveat is that I need for them to submit the value even if it’s out of range. We need documentation of the original value and corrective action. Is it possible to set up a flagged event (even simple, like text color) that would alert us that it is out of range?

Karen Pregnall, EdD, CT(ASCP), HTL(ASCP)

Lab Education Coordinator, Pathology and Lab Medicine

Adjunct Assistant Professor, Dept. of Health Studies

Medical University of South Carolina

843-792-4013


Oh yes absolutely, simply use a formatting rule instead of a validation rule. Add the rule to the appropriate control and have the background color change to Red when invalid.


How do I use AND function with more than two boolean conditions?

Formula Builder

and(isNullOrEmpty({Self}),not(isNullOrEmpty({ItemProperty:Pre_x002d_Proposed_x0020_P7_x002})),greaterThan(PlannedP7Date,{ItemProperty:Pre_x002d_Proposed_x0020_P7_x002}))

Hey Pankaj,

Can you provide some more context on your scenario? This is for a Form, but in a Rule, or an expression in a control setting? If a rule, what type of rule?

Do you want the formula to read 

If PlannedP7Date is greater than Pre Proposed P7 AND ThisControl is not empty AND Pre Proposed p7 is not empty


Hi Andrew, that is exactly correct? I have done this instead because looks like you cannot have more than two variables per AND function

Formula Builder

and(isNullOrEmpty({Self}),and(not(isNullOrEmpty({ItemProperty:Pre_x002d_Proposed_x0020_P7_x002})),greaterThan(PlannedP7Date,{ItemProperty:Pre_x002d_Proposed_x0020_P7_x002})))
You need to have a nested AND. This worked fine.

You got it! You do need the nested AND operators in this case.


Andrew, I have a scenario where once a value is added to the form, a box pops up and says you need XX level of approvals. I can do that easily with a rule for (value control < 100) and (value control > 500) But I put in exactly what you have above and I cannot get the level 2 which is >1000 and < 500 to work. My function is (Value Control<=100)&&(ValueControl>=500) is there something I am missing


I made this 2 separate rules. so that worked


I wish we could get one for "Contains" happy.png


I have a sequence (12) of questions which I want to hide depending on the previous answer.

 

The first question is always visible so no rule required.

The second question I have used isNullOrEmpty(control) then HIDE on the first control

The third control I have used isNullOrEmpty(control) then HIDE on the second control

etc all the way down.

 

The form is now blank and I am not sure why. 

 

my isNullOrEmpty is very straight forward, the brackets only contains the variable which has a column setting default of (empty). 

 

isNullOrEmpty(Couldcustomeractivitybemanagedwithinexceptionsfor5businessdaysrollfromspotorpredeliveries)

 

Anyone know what i am doing wrong?


hi 


I'm trying to apply this rule to pplpicker control and another textbox control but I dont get the response wanted 


and(and({ItemProperty:WFStatus}=='Pending Division Manager Review',Is Edit Mode),


or({ItemProperty:DivisionManager}==CU,{ItemProperty:DivisionManager}=={ItemProperty:Requestor})) 


please help I tried to divide my rule but does not come the disired result


 


Reply