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

Can I lookup a person in a table based on a people picker drop down?

I have a table called "Requests" with a person field called [Requester]. 

I have a second table called "Employees" with a person field called [Employee] and another field called [Team].

The fields on my form are named the same. 

On my Nintex form, Requester is a people picker.  Once the person is selected, I would like to do a Lookup on the Employees table to pick up the Team.

I tried to use this Calculated Value -- lookup("Employees","Employee",Requester,"Team"), but I just get a blank.

Does anyone have any idea how to do this?

P.S.  The team name stored in the table is not available in the userprofile.

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

Re: Can I lookup a person in a table based on a people picker drop down?

Any ideas?

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Can I lookup a person in a table based on a people picker drop down?

person or group field works like a lookup field.

so you can query its value by a sharepoint user ID like

lookup('Employees','Employee',EmployeeUserID,'Team',false,'Lookup')

or by sharepoint user Display name like

lookup('Employees','Employee',EmployeeDisplayName,'Team')

the main problem here is that people or group form control doesn't resolve to either of these two values, so you can not directly use it as an input to lookup() function.

if you have running profile services, you could use userProfileLookup() function to get (eg) employee display name.

if you do not, you will have to find other way how to determine one of these values, but it will need additional javascript code.

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Can I lookup a person in a table based on a people picker drop down?

Thank you for your reply.  Would you, or anyone, happen to have java code so I can input a name via a peoplepicker, and lookup that name in a list (Employees), so I can reference associated data such as team, role, etc?

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Can I lookup a person in a table based on a people picker drop down?

if you have only single entry in PP field you can get selected user's display name with following code

NWF$('#' + jsvarPP).siblings('.ip-item').find('.ip-item-content').text();

so you can wrap it into a function and then reference the function in your lookup

0 Kudos
Accept as Solution Reply