Turn two fields mandatory if one of both is used

  • 17 January 2018
  • 3 replies
  • 4 views

Badge +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

Badge +9

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"

Badge +9

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

Badge +1

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

Reply