cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Turn two fields mandatory if one of both is used

In my form there are two single line text fields [Field A] and [Field B]. If both fields remain untouched, the user can submit the form. Does the user fill out [Field A], [Field B] should turn mandatory and vice versa. 

How can I perform this reciprocal validation?

Thank you for your help.

Labels: (2)
0 Kudos
Reply
3 Replies
Workflow Hero

Re: Turn two fields mandatory if one of both is used

Hi Al, 

You would need to make the fields optional on the sharepoint list, and only do Nintex form validation on the form. 

Put a validation rule on Field B, to be something like this: 

IsNullorempty(FieldB) && !isNullorEmpty(FieldA)

error message to display: "Field B cannot be blank"

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Turn two fields mandatory if one of both is used

Oh, I missed the "vice versa" part. 

in addition to the rule above, do another one on Field A (same concept):

IsNullorempty(FieldA) && !isNullorEmpty(FieldB)

or;

 IsNullorempty({Self}) && not(isNullorEmpty(FieldB))

Accept as Solution Reply
Workflow Hero

Re: Turn two fields mandatory if one of both is used

Thank you Christine. If I do so, the error remains even if both field are filled out...?

0 Kudos
Accept as Solution Reply