Skip to main content
Nintex Community Menu Bar

How to compare two people picker fields on the form

  • Aug 29, 2017 2:12 PM UTC
  • 5 replies
  • 40 views
  • Translate All

Forum|alt.badge.img+5

How to compare people picker fields on the form?

For example if people picker1 is equal to people picker 2 then make field 2  mandatory ( field 2  mandatory rule written on the form).

Thanks in Advance!

5 replies

Forum|alt.badge.img+16

Add a rule on field 2 as follows:

ensure you use Named Controls (in example above PP1 and PP2 are the named controls of my two people picker fields)

Translate

Forum|alt.badge.img+14
  • Scholar
  • Aug 29, 2017 9:20 PM UTC

equals() compares just strings and is not reliable on people picker controls - How to comapre two people picker controls? 

I recommend to use dedicated userEquals()

Translate

Forum|alt.badge.img+16

oh well it seemed to work fine when I just tested it.

Translate

Forum|alt.badge.img+8
  • Aug 30, 2017 7:04 AM UTC

I believe you should use this function userProfileLookup() in the same equal() function above to get the display name string then it will work 

 userProfileLookup("domainlogin", "InternalPropertyName") 

It will be something like this

equal(userProfileLookup(pp1, "PreferredName"), userProfileLookup(pp2, "PreferredName"))

Translate

Forum|alt.badge.img+14
  • Scholar
  • Aug 30, 2017 8:13 AM UTC

1. user's display name is not unique user's identifier. you can have several users with the same display name and different logins, and vice versa single user might have several difference accounts with the same display name.

2. userProfileLookup() works only on SP Server and above editions.

Translate