Skip to main content
Nintex Community Menu Bar

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

  • Feb 22, 2018 3:15 AM UTC
  • 4 replies
  • 45 views
  • Translate All

Forum|alt.badge.img+7

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.

4 replies

Forum|alt.badge.img+7
  • Author
  • Feb 24, 2018 4:15 AM UTC

Any ideas?

Translate

Forum|alt.badge.img+14
  • Scholar
  • Feb 28, 2018 9:11 AM UTC

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.

‌ ‌ ‌ ‌

Translate

Forum|alt.badge.img+7
  • Author
  • Apr 12, 2018 3:38 PM UTC

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?

Translate

Forum|alt.badge.img+14
  • Scholar
  • Apr 13, 2018 10:18 AM UTC

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

Translate