isNullorEmpty rule condition not working


Badge +3

In Nintex form, I have disabled a button with rule condition isNullorEmpty(textfield) based on another text field. If the text field is empty or null, then this button will be disabled.

The rule seems to work for the first time only. When the form was loaded, the button was disabled until I enter something into the text field. However, the button was not disable when I go back and delete all the data in the text field.

Does anyone have this similar issue?

Please share your thought.

Thanks,

Emily


16 replies

Badge +5

Hi ‌, can I know which Nintex Forms version are you using?

Badge +3

Hi Abdullah,

Version 2.11.0.1.

We have upgraded to this version recently.

Regards

Emily

Badge +5

I assume you are using Nintex Forms 2013, right?

Weird, I'm using the latest version and the isNullOrEmpty() function seems to work fine.
Everytime I remove text, the button is disabled and adding back text, the button is enabled.

Userlevel 5
Badge +14

I go back and delete all the data in the text field.

did you as well leave the text field after you deleted content?

check developer console whether there are not reported any errors.

Badge +3

Abdullah - That's correct. I'm using Nintex Forms 2013.

Marian - Yes. I did leave the text field after deleted content.

I have figured out the root cause of this issue. It's not working because my text field is a "Multiple Line of Text" with the "Plain Text" SharePoint (SP) column setting. If I change it to "Enhanced rich text (Rich text with pictures, tables, and hyperlinks)", the button work perfectly.

However, I come across another issue, if I change my text field SP column setting to "Enhanced rich text (Rich text with pictures, tables, and hyperlinks)", the text field was disabled (not able to type anything) when the form was loaded. Can anyone please shed some light?

Badge +6

Hi,

I would check that you haven't applied your rule to the text field accidentally. There should be no reason for it to be disabled unless it is either defined in the control setting or there is a rule applied. Regardless of this, the fact that the field is a plain text or Rich text should not impact the result if you are wiping the content from the field.

Cheers,

Mark

Userlevel 5
Badge +14

Are you really talking about formatting rule?

or did you configured an appearance settings formula?

can you post a screenshot what and how exactly you configured it?

Badge +6

Hi,

I just did a quick test and cannot replicate the issue. With a multiline text control added to the form and connected to a Instruction column defined the same as you have (with plain text), the rule works without issue. When there is no text in the field, the button is disabled. When I type, the button is enabled and when I remove the typing , the button disables again.

Have you tried switching the rule around so that your Instruction rule applied to the submit button and the Comment rule to the Save button. Or have you tried not having it connected to the columns at all - this would totally rule out the column definitions being a reason for the issue?

Cheers,

Mark

Badge +3

Hi All,

 

I managed to resolve my second issue where the multiple text field was disabled after I switched the List column to "Enhanced rich text (Rich text with pictures, tables, and hyperlinks)".

I suspect the Panel somehow blocked this field in Nintex form.

Set the field to “Bring to Front” has fixed issue.

 

 

However, my first issue still not resolve.

Here is the simple settings of my form.

 

First column (Comments) setting in SharePoint List, with “multiple lines of text” type and Enhanced rich text (Rich text with pictures, tables, and hyperlinks)” option.

Second column (Instruction) setting in SharePoint List with “multiple lines of text” type and Plain Text” option.

 

The rule settings in Nintex form look like this.

For Save button, it is disable when the Comments multiple text field is null or empty. For Submit button, it is disable when the Instruction multiple text field is null or empty.

When the form first loaded, these two buttons were disabled.

The Save button was enabled when I type something in Comments, disabled when I remove the text.

 

However, the Submit button was not disabled, when I type the text in Instruction and then remove the text.  I have tried moving my cursor to other field but the Submit button still enabled.

So the issue was “isNullorEmpty” only work for Multiple lines text with Enhanced rich text (Rich text with pictures, tables, and hyperlinks)” option.

 

Cheers,

Emily

Badge +3

Hi Mark,

The issue still occurs even though I switched the rule around or disconnected the List Column in Control Settings.

Cheers,

Emily

Badge +6

Ok - well that rules out the issue being related to the column format. What if you delete the field on the form and recreate it? At this stage I would still leave it not connected, until you sort the logic out.

Badge +5

Hi Emily Tan

I guess you are right. The rule works properly only with Multiple lines of text of Rich Text or Enhanced Rich Text.

Userlevel 5
Badge +14

for me it works correctly for both plain & reach text settings of multiline text field

after form is loaded

209821_pastedImage_2.png

after I type in some text

209820_pastedImage_1.png

after I delete text

209822_pastedImage_3.png

rule applied to one of buttons

209823_pastedImage_4.png

'Is empty?' formula

209824_pastedImage_1.png

Userlevel 5
Badge +14

have you checked developer console for errors as I advised above?

do you have any other rules applied to the button(s)?

or any CSS formatting applied?

or possible s javascript code that changes button behaviour and or appearance?

can you add calculated value control on the form with the same formula as in formatting rules to see how do they evaluate?

Userlevel 5
Badge +14

Instead of just using isNullOrEmpty({Some:Control}) could you perhaps try a rule like: 

isNullOrEmpty(trim(MLControlHere))

I could not replicate your problems with a Multi-Line text field for both the Rich and Plain Text variants, however, I did notice that without trimming, you could sometimes make it look as if everything had been deleted when in fact, there would still be some white-space present inside of the control, which would make a function like isNullOrEmpty() return false and subsequently leaving your button enabled.

Badge +4

I am having the same issue as well. I have a formatting rule that disables a button on the form if the multiple lines of text control is empty.  The rule works 100% of the time as rich text, but very rarely works when switched to plain text, and when it does work, after typing and clearing the field a few times, it usually stops working.

I've tried the suggestions here and nothing seems to work. 

I created a new form entirely, stripping out any custom JS, CSS, or additional rules, and added one MLOT field and put a disable rule on the button for testing. 

I used a calculated value to evaluate whether the field is null or empty, and the CV matches the behavior of the button - even when the field is empty, the CV will show False.  On the rare occasion where the rule is working properly, the calculated value will evaluate correctly, until it eventually stops updating and the disable rule is no longer evaluated.

If I save the form with nothing in the MLOT field (because the rule isn't working), I go to the list and there is no value or whitespace in that field.  And the trim command doesn't seem to have any effect either, presumably because there is nothing to trim.

Any other ideas?  Or should I just contact Nintex Support?

Unfortunately it is not as simple as just making that a rich text field - we get to a lot of the data programmatically and that would cause some serious headaches.  So at this point, my options are to switch those all to single line of text fields (with the 255 character limit, not really feasible) or find a way to get that working.

Reply