Skip to main content
Nintex Community Menu Bar

How to validate a List lookup control

  • June 20, 2018
  • 7 replies
  • 27 views

Forum|alt.badge.img+11

Hi 

I want to make sure a value is selected from a List Lookup control. 

216660_pastedImage_1.png

216661_pastedImage_6.png

I've tried using : isNullOrEmpty(parseLookup(ProjectLookup,True))  and can't see why this won't work.

No value is returned from the parseLookup if nothing is selected in the drop down, however isNullOrEmpty seems to think something is returned as it is never invalid.

I've also tried separating out the parselookup to a calculated value with a name and then validating that for empty. Still doesn't work. 

I've also tried validating the control itself on 'ProjectLookup'. I feel like that should work as well. isNullOrEmpty(ProjectLookup) or isNullOrEmpty(self)

Not sure what else to do.

7 replies

MegaJerk
Forum|alt.badge.img+14
  • Scholar
  • June 20, 2018

Interesting. The rule: 

isNullOrEmpty({Control:Self})

should do exactly what you're after. Just copy and paste the above text into your editor. 

Here is the same rule in a formatting rule that turns the background into a terrible purple-ish color if the field is left blank. 

216683_pastedImage_1.png

This is the result when nothing is selected: 

216684_pastedImage_2.png

This is the result otherwise: 

216685_pastedImage_3.png


Forum|alt.badge.img+11
  • Author
  • June 20, 2018

Well I had already tried that along with many other options. Why does this work for formatting and not for validating? Although it does bring it to their attention it doesn't stop them from leaving it blank. 


MegaJerk
Forum|alt.badge.img+14
  • Scholar
  • June 21, 2018

So, if you're just taking the rule above, and you're putting it into a Formatting Rule and finding that it does at least work. 

Switching it to Validation should also make it work for Validation. 

However... There may be something else going on that is causing the form to act strangely when submitting. 

Are you using a Save and Submit button or just a Save and Continue? 

If you're using a Save and Submit button (which should kick off Validation Rules), do you see the control go invalid before being submitted? 

If so, right before you submit the form, could you maybe press F12 to open up the Developer's Console in your browser and then see if any errors are logged once you do hit that button? 

I have had an experience before that was similar to your when I put a control inside of a Repeating Section, and using the Control's properties, setup some min / max math values on it. For whatever reason, generating a new row would break the Rule System and allow me to do silly things like submit an invalid form. 



Forum|alt.badge.img+11
  • Author
  • June 21, 2018

I think that was the problem, in preview I was using the Save button instead of the submit button. Sigh. 


MegaJerk
Forum|alt.badge.img+14
  • Scholar
  • June 21, 2018

We've all been there happy.png 

Did it at least fix the validation issues? 


Forum|alt.badge.img+11
  • Author
  • June 22, 2018

oh yes. it worked all along, just not with a save. so all good now. thanks!


Forum|alt.badge.img+6
  • May 7, 2019

Was reading through this thread as I am searching for a solution that involves a List Lookup and validation rule. My situation is just slightly different, but very close. I have a List Lookup on my form that has two drop down values (Add New Vehicle and Replacement Vehicle). These each are connected to a panel via a rule to hide/unhide depending on the value selected in the drop down (list lookup). 

 

I am trying to add a validation rule to the next set of sections: Year, Make, Model. These are single text input fields. What I am attempting to build are validation rules that require an input to Year, Make, and Model. If the field is empty, then it would display a message requiring information be input.

 

I have tried a few things based on solutions that others have used but when I click the Save/Submit button, it doesn't stop and fire the message. Alot of what I have seen are validaiotn rules working on a Choice menu. Any thoughts?