cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

How to compare two people picker fields on the form

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!

Labels: (1)
0 Kudos
Reply
5 Replies
Workflow Hero

Re: How to compare two people picker fields on the form

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)

Reply
Workflow Hero

Re: How to compare two people picker fields on the form

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

Reply
Workflow Hero

Re: How to compare two people picker fields on  the form

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

0 Kudos
Reply
Workflow Hero

Re: How to compare two people picker fields on the form

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("domain\login", "InternalPropertyName") 

It will be something like this

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

0 Kudos
Reply
Workflow Hero

Re: How to compare two people picker fields on the form

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.

Reply