Recent

Persons name vs login name in NWF emails

SharePoint list and libraries store people picker columns (i.e. Created By, Modified By, Assigned To, etc) values as the person’s claims based login name to ensure each value is unique. If you are using a Nintex Workflow and try to populate a text field or include one of the people picker fields in the email body, their login name will display. Take a look at the Nintex Workflow example below, the email has the ‘Created By’ field reference in it, but when the email is sent it’s displaying the login name:
Nintex-WF-People-names-15-1

Get a Persons display name in Nintex Workflows

To get a person’s name to display in a workflow email instead of their login, you will need to create a workflow variable and populate that variable with the person’s user profile name.

**If you have Nintex Workflow Enterprise edition, there is a ‘Query User Profile’ action which can be used instead of the ‘Set variable’ action displayed below.

1. Either create or edit an existing Nintex Workflow. Add a Set variable action to the workflow.
Workflow-Username-15-1

2. Double click on the action to configure the action, click on the Variables icon.
Workflow-Username-15-2
3. Click on the New icon on the Workflow Variables popup window, then enter a Name for the Variable. Click the Save button which will close the window. Then click the Close button which will close the window and return you to the Configure Action – Set variable window.
Workflow-Username-15-3

4. A. Now you can choose your variable in the Set dropdown field.
B. Choose User Profiles from the Equals dropdown menu.
C. Choose Name from the Source dropdown menu.
Workflow-Username-15-4
5. Click on the Insert Reference icon, on the Insert reference popup window click on the Item Properties tab. Choose the people field which you want to get the Name for. In this example we are going to use the Created By field. Click the OK button to close the popup window.
Workflow-Username-15-5
6. Your finished set variable action should look similar to the example below. Click on the Save button.
Workflow-Username-15-6
7. Add a Send notification action to the workflow beneath the set variable action.
Workflow-Username-15-7
8. The person’s name can either be inserted into the Subject field, or in the email Body. Do not insert the workflow variable into the To, CC, or BCC field. The variable is only the display name, it might not be unique like the people field is.
Workflow-Username-15-8

In this example, click in the email body where you want the persons name to appear. Then click on the Insert Reference icon.

9. On the Insert Reference popup window, click on the Workflow Variables tab, click on your workflow variable you created. Click the OK button to close the Insert Reference popup window.
Workflow-Username-15-9

10. Your send notification action should look similar to the example below, with your workflow variable listed in either the Subject or email Body field:
Workflow-Username-15-10
11. Add descriptive names to your workflow actions, then Publish your workflow.
Workflow-Username-15-11

Finished Product: The workflow email now displays the name of the person instead of their login:
Workflow-Username-15-12

About Nick Hurst (84 Articles)
SharePoint and Nintex developer who strives to find easy to deploy and maintain solutions for business problems.

4 Comments on Persons name vs login name in NWF emails

  1. Hi Nick, thanks for this article, can you please also explain how it could work, when you have a col of names? An get all of them in Displayname

    Like

    • I’m assuming you are trying to get the display names for a people picker field with multiple values?

      That requires a little more work, first you have to use a Regular expression action to save the people picker values into a Collection variable.

      Then do a for-each action for that collection, inside the for each place the Query User Profile Profile action.

      Finally below the Query User Profile action and still inside the for-each, you need a Collection Operation action to store the Query User Profile variable into a new collection variable.

      Like

  2. Hi I am so delighted I found your web site, I really found you by mistake, while I was browsing on Bing for something else, Regardless I am here now and would just like to say thank you for a incredible post and a all round thrilling blog (I also love the theme/design), I don’t have time to browse it all at the moment but I have bookmarked it and also added in your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the fantastic b.

    Like

  3. Thanks for your personal marvelous posting! I actually enjoyed reading it, you might be a great author. I will always bookmark your blog and will often come back in the future. I want to encourage you to continue your great work, have a nice evening!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: