New Responsive: Get Manager name (not loginID) via profile lookup?

  • 18 October 2019
  • 4 replies
  • 214 views

Badge +3

Hello all,

 

I'm trying to show the Manager Name (PrefferedName) on a New Responsive form. I'm able to get the LoginID using: 

 

userProfileLookup([Form].[Employee],"Manager") -- Note "Employee" is a people picker form field. 

This returns a value like this: i:0#.f|membership|email@address.com

 

I then tried to pump that into another user profile lookup: 


userProfileLookup([Form].[ManagerLoginID],"PreferredName") -- Note "ManagerLoginID" is the variable capture from above. 
 

But that returns no result on the preview, or the published form. Is there anyway to get to the Manager PreferredName (or any other property, like email) using variables? 

 

Thank you.


4 replies

Userlevel 3
Badge +9
Euan has an excellent video detailing how to figure out the case sensitive user profile properties to reference in Nintex Forms for O365: https://www.youtube.com/watch?v=mBr1xrmpv9U

After reviewing the user profile properties in https://YourDomain-admin.sharepoint.com/_layouts/15/TenantProfileAdmin/MgrProperty.aspx?ProfileType=User&ApplicationID=00000000%2D0000%2D0000%2D0000%2D000000000000
I don't see the PreferredName property anywhere.

However the Manager's name can be access using the following two steps:
1) Create a variable with following definition:
UserProfileLookup(userProfileLookup([Context].[Current user email],"Manager"),"FirstName")
+ " " +
UserProfileLookup(userProfileLookup([Context].[Current user email],"Manager"),"LastName")

2) Assigned the variable to a form control (like a Label or Text - Short).
You'll see the result only when executing a published form.
Badge +3

I apprecaite you taking the time to reply. A couple of notes (remember that the manager property returns this format: i:0#.f|membership|emailaddress@domain.com): 



  1. PrefferdName does work as a propery. If I hardcode somethign like this it works fine: 
    userProfileLookup("emailaddress@domain.com","PreferredName"). 

  2. Even when using FirstName or LastName, this still does not work when using a nested userprofile lookup like your example. I entered this exactly: userProfileLookup(userProfileLookup([Context].[Current user email],"Manager"), "FirstName") and get no result. 

  3. IF I hardcode it like this: UserProfileLookup(userProfileLookup("i:0#.f|membership|emailaddress@domain.com","Manager"),"FirstName") it WORKS fine. SO it seems to only not work when the context of the nested userProfileLookup is dynamic. 


Given number 3, it seems more like a bug. 

Badge +3

Euan's video sorted me out.  There are some quirks when using variables that were messing me up.


 


As I wrote on a comment on that video: " Using the "context" of current user works for your variable example, but not the "context" of a people picker. I'm guessing variables don't update dynamically, only on load."


 


Also, the variable example in my number 2 above works in published form, but not in preview. My appologies for claiming it didn't work. 


 


Hopefully this thread will help others in the future. Step 1: WATCH EUAN'S VIDEO! :)

Badge +6

Thank you!  Excellent video, however we have many forms that are filled in by administrators on behalf of others.  Is there no way to update the Manager based on the new person entered into the people picker field in the New Responsive form?

Reply