Skip to main content
Nintex Community Menu Bar

Turn two fields mandatory if one of both is used

  • January 17, 2018
  • 3 replies
  • 10 views

Forum|alt.badge.img+1

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.

3 replies

Forum|alt.badge.img+9
  • Novice
  • January 17, 2018

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"


Forum|alt.badge.img+9
  • Novice
  • January 17, 2018

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


Forum|alt.badge.img+1
  • Author
  • Nintex Partner
  • January 18, 2018

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