cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Workflow Hero

Issues with isNullOrEmpty in validation rules

Hello everyone,

I've got a big issue with multiple forms in multiple subsites.

I wrote some validation rules like this : 

isNullOrEmpty({self}) && equals(ExampleControl, « example »)

It worked fine for more than a year.

But, last friday, all the validation rules with "isNullOrEmpty" stopped working.

The rule was supposed to work when my control "ExampleControl" (which is a choice control) was set on "example" AND the single line text ({self}) was not empty.

Now, even if the "ExampleControl" is set on another choice than "example", the validation works.

Even if the "ExampleControl" is set on "example" AND the single line text ({self}) is not empty, it works too.

But it doesn't respect my rule.

I saw this issue in other request with some replacement like instead of "isNullOrEmpty" => equals({self}, "") and it works. 

But i want to know why is this happening from one day to another.

Thank you for helping me.

Labels: (2)
0 Kudos
Reply
17 Replies
Workflow Hero

Re: Issues with isNullOrEmpty in validation rules

I just tested this for you in the newest release of forms for 2013, Version: 2.9.4.0

, and the "equals" function seems not to be working correctly against a choice control.   When i use   ==   instead of equals it works as expected.  You may want to report this as a bug to nintex support.  

equals(choiceControlreference, "example")    ---- passes validation when example is selected

choiceControlreference == "example"              ----triggers validation when example is selected

Anyone seeing this?  What version are you on.

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Issues with isNullOrEmpty in validation rules

Testing now in Nintex 2013, Version 2.9.0.0.. works as expected. Must be an issue introduced between versions somewhere...

Accept as Solution Reply
Workflow Hero

Re: Issues with isNullOrEmpty in validation rules

for me it works both ways on 2.9.4.0

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Issues with isNullOrEmpty in validation rules

any changes (upgrades, patches,...) on your environment?

have you tried to dig into it deeper?

eg. any error on developer console

how does evaluate {Self}

how does evaluate isNullOrEmpty({Self})

hasn't {Self} changed somehow from referenece to simple text

etc.

Accept as Solution Reply
Workflow Hero

Re: Issues with isNullOrEmpty in validation rules

Can you guys test it using the "checkbox" mode of the choice control?  Perhaps only in this mode is the glitch becoming evident.

This mode allows for multi-select, but the single selection of "example" does not function correctly as I described above.  I'd like to know if you experience the same.

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Issues with isNullOrEmpty in validation rules

in case of possible multiselect control returns array of values, so InArray() function should be used to validate an option is chosen

equals() probably takes it literally and so fails, whereas javascript recognizes single value in an array and compares it as string

Accept as Solution Reply
Workflow Hero

Re: Issues with isNullOrEmpty in validation rules

Ah ha, you are correct sir..

Accept as Solution Reply
Workflow Hero

Re: Issues with isNullOrEmpty in validation rules

Right on, I just wanted to confirm that equals in and of itself does fail for you as well. That's a good starting point for a workaround for  which can be modified to mimic the equals req with a little work.  

Accept as Solution Reply
Workflow Hero

Re: Issues with isNullOrEmpty in validation rules

Those are among some of my favorite words to hear. LoL. (I do jest).

Accept as Solution Reply