cancel
Showing results for 
Search instead for 
Did you mean: 
chelledavis11
Nintex Newbie

How to NOT allow users to enter a blank space in a field - Field Validation

I have a form with a lot of validation based on what item is selected from a dropdown.  An issue I just discovered was that even though I have the NotValidIfNullOrEmpty the data can still accepted (Saved) if a space is "entered" - I go into the field and physically enter a space. What is the best way to handle that problem? I tried adding on to the statement in the attached graphic: OR IF Field = " " THEN it would be invalid, but I was able to save the item.

Update 1: I am now trying to work with the Regular Expression. I am getting closer but still not the desired output: I entered this expression:

^.*(?=.*\d)(?=.*[a-zA-Z]).*$

It works to some extent BUT I can still enter a blank space and the form saves

0 Kudos
Reply
7 Replies
Automation Master
Automation Master

Re: How to NOT allow users to enter a blank space in a field - Field Validation

try: IsNullOrEmpty(trim(ctrl))

Reply
chelledavis11
Nintex Newbie

Re: How to NOT allow users to enter a blank space in a field - Field Validation

Thank you so much! 

That worked. 

But, only in an instance with one item being validated. Once I tasted on all of the items it went back to the same behavior. A space in any of them allowed the form to still be saved as if data was entered. 

Reply
chelledavis11
Nintex Newbie

Re: How to NOT allow users to enter a blank space in a field - Field Validation

I tested various combos of filled-in vs blank space vs no data entered and the outcomes are inconsistent. Sometimes the NO BLANK space works but then in another field it allows it.

0 Kudos
Reply
chelledavis11
Nintex Newbie

Re: How to NOT allow users to enter a blank space in a field - Field Validation

What I had to do: Since the solution offered seems to work partially I spent time trying to figure out what accounted for the "inconsistencies".  What worked in the end was deleting ALL the validation rules that used this formula an re building them. Going through and making edits seemed to somehow muddy the water and I ended up getting more erroneous outputs with each try. Staring fresh and one-by-one seems to have solved the issue. 

Reply
Highlighted
chelledavis11
Nintex Newbie

Re: How to NOT allow users to enter a blank space in a field - Field Validation

UPDATE: The solution was a partial fix. It gave unexpected results in some of the choices. The validation was failing at some points. Once I removed the trim for re-testing the validation works as expected - assuming no-one enters a blank space. With the TRIM the validation itself was failing on several of the options. Perhaps I have too many variables to properly use the TRIM in this instance? 

Also see:  

0 Kudos
Reply
Automation Master
Automation Master

Re: How to NOT allow users to enter a blank space in a field - Field Validation

have you noticed any pattern when it works and when not?

if you get incosistent results check developer console for any errors. if there are reported any you will have to fix them all first.

try to add set of calculated value controls to evaluate each (sub)expression of your above formula separately.

ie. single formulas will look like:

ReviewType
ReviewType=='Available Capacity'
StreetAddress
trim(StreetAddress)
length(trim(StreetAddress))
isNullOrEmpty(trim(StreetAddress))
...

whole expression on the right of && operator

whole formula

post a screenshot how do they all evaluate for a case when you are able to submit a form but shouldn't be able to.

0 Kudos
Reply
chelledavis11
Nintex Newbie

Re: How to NOT allow users to enter a blank space in a field - Field Validation

I will try making the change after QA test. I sent it back to them without the TRIM to set the validation. I did not make them aware of what I did as yet.   But what happened to me was the validation worked.  Worst case we may have to live with the space possibility if the TRIM is causing the odd behavior.  

0 Kudos
Reply