Skip to main content

I have been looking for a way to conditionally validate a lookup selector field in Nintex Forms. Basically, I need the field to be required when a previous column has specific values selected and not be required if any other values are selected.


This seems like it ought to be simple, but using anything like the below does not work:

isNullOrEmpty(LookupSelectorField) && (ChoiceField == "A" || ChoiceField == "B" || ChoiceField == "C")

This doesn't work either:

LookupSelectorField == "" && (ChoiceField == "A" || ChoiceField == "B" || ChoiceField == "C")

Is there any way to conditionally require a lookup selector on the form?

first formula should work.

have you chosen LookupSelectorField  and ChoiceField from named controls in formula builder?

could you post screenshot of your rule?


Hi Marian,

I did select both the lookup selector and the choice field from the named controls section. Below is a screenshot of the Rule and the Formula Builder.

Rule Formula Builder

Thanks!


that's sound to me to be correct.

check developer console for any errors. if there are any reported, resolve these first.

add calculated value controls on the form and configure their formulas to evaluate single expressions of your overall rule.

like

selRelatedCompound

isNullOrEmpty(selRelatedCompound)

TAFunction

TAFunction=="Onc"

....

watch (ev. post) whether single expressions evaluate correctly or not.


There are no errors in the dev console (F12).

The calculated value fields are working and show when the lookup selector is null and when the individual TAs are selected, but the rule still does not work. Even reduced the rule to a single selection in the TA/Region field (no ORs) and it still does not work.


Strange. No validation rules work at all. All of my formatting rules work, but I can't get any kind of validation rule working at all. Just tried to do a similar rule to the original I posted for a choice field. It should be required when "Regional" is selected in the previous choice field. Does not work.


hm, sounds like something is broken on your form/page.

does it work if you turn validation rule into a formatting one and let it eg. change some color?


Yes. Changing the rule to a formatting rule changing the color, font size and font style works perfectly. I've also found that in some other forms I'm working on in the same environment (same site collection but different site), validation rules work fine. Definitely something broken here. I hope I don't have to rebuild!!!


hopefully, the rule is assigned to a form control, isn't it?

can you try to create a brand new validation rule with a formula that always evaluates to true (like: 1==1) and make it very first rule in the list. does it cause form validation to fail?


This issue was apparently a broken form. Could not find any reason the rule should not work, but once I rebuilt the form in the same environment, the new form worked without issue. Sorry this doesn't help anyone with similar issues.


Reply