Issues with isNullOrEmpty in validation rules

  • 27 February 2017
  • 17 replies
  • 12 views

Badge +4

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.


17 replies

Userlevel 5
Badge +12

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.

Userlevel 6
Badge +15

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

Userlevel 5
Badge +14

for me it works both ways on 2.9.4.0

200009_pastedImage_1.png

Userlevel 5
Badge +14

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.

Userlevel 5
Badge +12

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.

Userlevel 5
Badge +14

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

200021_pastedImage_1.png

200022_pastedImage_2.png

Userlevel 6
Badge +15

Ah ha, you are correct sir..

Userlevel 5
Badge +12

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.  

Userlevel 5
Badge +12

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

Badge +4

Thank you guys for your help but the problem is not really the equals().

I'll try to explain better my issue.

I have a single line text control which is disabled and hidden if the choice control is set to "No".

If it set to "Yes", the single line text control is enabled and visible AND is obligatory.

The real problem is it worked for more than a year!

And now it stopped working!

I understand that maybe the isNullOrEmpty is not the perfect function for this but it worked before. And now there is more than 900 workflow working on.

All your solution works for me, but I really need to find a way to understand why all the validations stopped working from one day to another.

Anyway, thank you for your helps even if it's not answering exactly, it make me see some better stuff to do in the future.

Userlevel 5
Badge +14

I have a single line text control which is disabled and hidden if the choice control is set to "No".

how do you disable and hide controls? rule appearance settings?

is configured directly for single controls or do you have controls in a panel and settings applied on a panel?

have you investigated it further as I suggested above?

Userlevel 5
Badge +12

Did you upgrade your Nintex version recently?  Breaking changes are not totally common, but they do occur. 

Badge +4

Hello ‌,

The control is hidden and disabled by another rules with just an equals().

it's configured directly for single controls.

There was absolutly no changes on the environment, no updates of nintex, sharepoint, windows, etc..

No error in the dev console.

Badge +4

Hello ‌,

No upgrades recently. And the sql db is not full at all.

Userlevel 5
Badge +12

Hello Pierre,

Just one more clarification:   Are you using a Yes/No check box, or a choice control?   Originally I thought you were using a choice control, but now it sounds like maybe you are using a Yes/No checkbox.

Reason being, that long ago the isNullOrEmpty used to work on a Yes/No checkbox - then along came a new version of Nintex that made the rule no longer function with the Yes/No checkbox (the fact that isNullOrEmpty had originally worked was described to me as a glitch by support...Strange right?)

I can't really explain a sudden change without any modifications, but I do know an upgrade could cause this.  

Userlevel 5
Badge +14

what about patches/upgrades at client side, especially ones related to browser?

btw, have you tried how does it work in another browsers?

Badge +4

No, it's a choice control.

I knew this fact too, I thought about this immediatly but this validation rule stopped working for other controls like people/picker...

Yes that's pretty strange, I know....

I had this issue with an upgrade before, but this is absolutly not the same..

And now it seems working, but I don't know why......

I'll let you know what causes this bug if I find.

Thank you.

Reply