friedrich
Nintex Newbie

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.

0 Kudos
Reply
3 Replies
cmikhaiel_e
Nintex Newbie

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
Reply
cmikhaiel_e
Nintex Newbie

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))

Reply
friedrich
Nintex Newbie

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
Reply