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

Returning displayName using userProfileLookup

Jump to solution

I'm trying to use the following function for a calculated field on a form but no value is being returned:

     userProfileLookup(Current User,"displayName")

We're using Claims-based authentication for our SharePoint 2013 on-prem farm. So our user names are in the format of:

     i:0#.w|domain\username

The userProfileLookup in-line function help text listed the syntax of the function as:

    userProfileLookup("domain\login", "InternalPropertyName")

So I tried substituting a manual value for the current user value to see if maybe it was because our usernames were in Claims format:

     userProfileLookup("domain\username","displayName")

Still no dice.

What I'm attempting to do is use the display name of the current user in a form rules formula to hide a field on a form unless the current user is listed in at least one of several people picker fields on the form. But I'm struggling to get the Current User value into a format that will match the values in the people picker fields.

Using Nintex Forms 2013 Standard ver 2.5.0.0 and SharePoint 2013 Enterprise Aug 2015 CU

Labels: (3)
0 Kudos
Reply
8 Replies
Workflow Hero

Re: Returning displayName using userProfileLookup

Jump to solution

Hi Steven,

are you sure your internal property is called "displayName"? Have you tried "Name" or any other property to see if it's a bigger problem or just the wrong property name?

Cheers

Philipp

0 Kudos
Reply
Workflow Hero

Re: Returning displayName using userProfileLookup

Jump to solution

Yes, I've tried Name as well. I took your suggestion and tried to return "Department" and it's grabbing the correct value. Using ADSI Edit I've confirmed the displayName field of the account I'm testing with does have a value in it and according to Central Admin, it's properly mapped to the "Name" property name in our UPS service.

Using the following I get back the first name of the current user viewing the form:

     userProfileLookup(Current User,"FirstName")

Note that I get nothing back if I use the following with a space between First and Name:

     userProfileLookup(Current User,"First Name")

This lead me to think the UPS service was using a different value for the property name. So I checked the property mappings in our UPS and discovered you can find the "Name" of a property in the UPS by editing it. In the Property Settings section of the property you're trying to retrieve, look in the Name field. It turns out that the UPS is using "PreferredName" to represent "Name" which is mapped to the Active Directory property "displayName".

So using the following, I successfully retrieved the display name of the current user:

     userProfileLookup(Current User,"PreferredName")

Reply
Workflow Hero

Re: Returning displayName using userProfileLookup

Jump to solution

Here's a helpful link to a TechNet document that lists the user profile properties that SharePoint Server 2010 provides by default.

Default user profile properties (SharePoint Server 2010)

Reply
Workflow Hero

Re: Returning displayName using userProfileLookup

Jump to solution

Very useful post. To add to this, please make sure that the user profile app permission is configured at the site level.

To allow application to access user profiles:

- Go to Site Contents for your site, click the Nintex Forms for Office 365 app.
- On the upper right of the Nintex Forms for Office 365 page, click Nintex Forms Admin and then select Allow Application Access to User Profiles.

- Click Trust it.

0 Kudos
Reply
Workflow Hero

Re: Returning displayName using userProfileLookup

Jump to solution

Hello Debo, I don't see the "Nintex Forms Admin" option on the right like you are showing. I have signed in as a SharePoint Administrator as well as a Global 365 administrator. What could be causing this?

0 Kudos
Reply
Workflow Hero

Re: Returning displayName using userProfileLookup

Jump to solution

Hi Courtney,

You should be seeing this if you have at least Site Owner access to the site. Try adding yourself in the Site Owner group and see if that resolves the issue. Also make sure you have the recent version of the Nintex Form App ( I am running version 1.2.4.1).

If any of these don't work, I recommend to reach out to Nintex support for more targeted solution.

Thanks,

Debo

Reply
Workflow Hero

Re: Returning displayName using userProfileLookup

Jump to solution

Hello Debo, great suggestion! There is no "Site Owner" group for this site. I am a Tenant Admin, but I went ahead and granted myself "Full Control" as well, just to see and still no "Nintex Forms Admin" button showing! I am also in 1.2.4.1 and don't see an available update. I will reach out to Nintex to see if this can be resolved. Thanks for your assistance!

Reply
Workflow Hero

Re: Returning displayName using userProfileLookup

Jump to solution

Great. Keep me posted about the suggestion from Nintex support if you get a chance.

0 Kudos
Reply