Pages

Tuesday, June 16, 2015

Nintex: show user's display name instead of user ID in notification

There are three methods to show a user's display name (instead of a login ID) in an email notification. 

1. Set a Variable


1. In your list, create a column of type People Picker and name it Person.
- Set a workflow variable: displayName
2. Set Variable (workflow action)
- Set: choose workflow variable displayName
- Equals: User Profiles
Source: Name
Equals: List Lookup
Source: Current Item
Field: Person (your people picker column from your list)
3. Send Notification
- Insert reference to workflow variable displayName

2. Call Web Service


1. In your list, create a column of type People Picker. In this example, it is named Person.
In the workflow, create two variables:
- DisplayName - single line of text
- xmllResult - Single line of text
2. Call Web Service
- URL: http://yourserver/sites/yourSite/_vti_bin/UserGroup.asmx
- Username, Password - Choose an account that has at least read only access to your site
- Click on Refresh
- Web Method: GetUserInfo
- Editor Mode: SOAPBuilder
- Web service input: insert a reference (icon of a book to the right of the field), Item Properties, then click the Person column.  Click OK.
- Store Result in: (workflow variable) xmlResult
3. Query XML
- XML Source: XML
- XML: Insert Reference to the workflow variable xmlResult
- Output 1, Process using: XPath : //@Name
- Store Result in: (workflow variable) DisplayName
4. Send Notification
- Insert reference to the workflow variable DisplayName

3. Query LDAP


1. In your list, create a column of type People Picker. In this example, it is named Person.
In the workflow, create one variable:
- DisplayName - single line of text
- userID - single line of text
2. Build String - Use the fn-replace function to strip out the claims token from the User ID in the Person column.
- Text: fn-Replace({ItemProperty:Person},i:0#.w|domain\,) (replace text in red with a reference to the Person column., replace text in green with your domain.)
- Store Result in: (workflow variable) userID
3. Query LDAP - query Active Directory with the userID to get the display name of the user
- LDAP Path -  Click on the ldap picker icon. The right path is usually visible by default.  It will look something like this: LDAP://DC=domain,DC=dc,DC=dc,DC=com.  You may have to type it in.
- Username, Password - enter an account that has at least read only access to active directory. 
- Query - (&(objectClass=user)(samaccountname={WorkflowVariable:userID}))
Replace the text in red with a reference to the workflow variable from the previous step, userID
- Property to retrieve - type in "displayName" (no quotes), then click on Add.
- displayName drop-down write to variable DisplayName.
4. Send notification and insert a reference to your variable, DisplayName.

No comments:

Post a Comment