Forms rule to invalidate field if contains value from other field person or group

  • 14 February 2020
  • 4 replies
  • 44 views

Badge +1

I have two fields on a Nintex form: Document Owner and Document Approver(s). Both are person or group fields. 

I need to create a rule that if the Document Approver(s) field contains the same name as the Document Owner field, it becomes invalidated. The Document Approver(s) field is not restricted to only one person.

Essentially, I need to limit a person from being both an owner and approver for a document and would like to do this through rules on the Nintex Form. 

I can make it work with only one name in the Document Approver(s) field using this rule: DocOwner === DocApprovers, but that validates with equals, not contains. 


4 replies

Userlevel 6
Badge +22
Hi,

Have you tried the contains runtime function? contains(string, element)
Badge +1

Hello, thank you for reponding. I have, but don't know what to put in as the element. 

 

=contains(DocOwner, "?"). DocOwner is the Named Control, and I tested with the element as both the Item Propery, "Doc Owner" and the Named Control, "DocOwner" and neither worked. 

 

=contains(DocOwner, "Doc Owner")

=contains(DocOwner, "DocOwner")  

Userlevel 6
Badge +22
contains(DocApprovers,DocOwner)
Badge +1
Perfect, thank you! I shall now go brush up on formula basics in shame :)
Appreciate your quick responses and help.

Reply