Relevant to both Nintex Workflow 2013 and Nintex Workflow 2010.
This article describes two methods of looking up a user’s display name for use in a workflow.
Create a SharePoint list, and add a Person/Group column type. Create an item adding a valid user account to the domain/username column.
Note: SharePoint will display the user’s display name in the list view; however, when the workflow reads this value, it retrieves this value as domain\login for the user.
Open the Nintex Workflow designer, then add a Regular expression and Query LDA to the design canvas.
Click on the Workflow Settings drop down menu in the Ribbon, and select Variables. Create the following four variables:
The Query LDAP action needs to be able to utilize the information within the Person/Group field, we must first remove the DOMAIN\ component from the selected user, with the Regular Expression action.
The username should now be in a format recognized by LDAP queries.
This action will retrieve and store the required information within the displayName workflow variable.
Now we're going to demonstrate an alternative method of retrieving the display name by querying a SharePoint Web service using a Call web Service action.
On the same workflow, add a Call Web service, Query XML, and Send notification action to the design canvas.
The web service will return a fragment of XML.
This action will parse the XML returned from the web service to extract the display name value needed to be used in other workflow actions. The Xpath query will extract the Name value and store the result in the displayName2 workflow variable.
The displayName2 workflow variable should now contain the user's display name retrieved from SharePoint.
Note: The other option is to use the Log in History List action to log the above values/ workflow variables instead of sending an email notification.
Run the workflow on your SharePoint list item.
In the Call Web Service action described above you state, "
What might cause domain/username to be unavailable as an option to select in Item Properties? The authentication was successful and returned the list of web methods.
I do understand I am new to Nintex workflow and still getting my 'sea legs' here. However, after reviewing above and similar solutions in various question threads, I must say that, this is a very complex task to achieve a very common outcome: having the display names from a people/group field appear in an email body of a send notification action. My reference, is, of course, how it was achieved in SharePoint Designer. I know, I know: Nintex workflow isn't SPD. It is something much better and much more extensive. But, to have to jump through all these hoops in Nintex, as above, to achieve the same outcome that SPD achieves by simply checking the correct output when adding a people/group field to an email notification is astonishing given how wonderfully Nintex behaves in dominating other aspects of SPD workflow.
Can the ability to set the output type via a simple drop-down selection as in SPD (i.e. select 'display name' 'display names, semi-colon delimited,' etc) in a people/group field when added to the email body in the send notification action be looked into for a future release (I am on Version: 126.96.36.199)?
Hi Drew, thanks for taking the time to explain your experience and the difficulties you are having with this. I'd recommend adding your idea and feedback to Nintex's feedback site 1 - Nintex Workflow for SharePoint: Hot (324 ideas) – Customer Feedback for Nintex where others can comment and vote, and our product team uses this space as prioritization for features as well.
I could not get the LDAP method to work. It appeared I could not remove the regular expression in our Login ID, which is in the format of "i:0#.w|us\1110mu". In reviewing the resulting variable in the history log, the special character "|" (pipe) could not be removed and always yielded a variable in the format of "|1110mu" This appeared to be the point of failure. Is there a way to force recognition of this special character similar to getting the "\" character recognized as such by entering "\\" for it? I tried entering "||" and that didn't work.
The web service worked but only for a single user entered into my people/group field.
When two (or more?) were entered it failed with the error message:
Failed to invoke web service. Error returned from server:
<soap:Fault xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>soaperver</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.
Your example above only uses one individual. Can you demonstrate how the web service method would work for two or more IDs?
Hey Drew, could you please post this question in the Learn More space? This is past my knowledge, and that way it'll be more visible to the community, so they can chime in!
This just happened to me, too. While previously, as noted in my comments (below on this page), it worked, I no longer see the "domain/username" selection the "item properties" tab. ?? I am a sites collection admin, too, and am using my current credentials.
UPDATE: I was not paying attention to the entire exercise--just concentrating on the directions for each method. The 'domain/username' is not a system field...it's what we were asked to create at the top of this page! You can substitute ANY people/group field you have in a list, including Created By and Modified By, which is what I needed.
First, I discovered how the "\" works here. Placing it in front of the pipe such as in i:0#.w\|us\\1110mu removed it and the back slash.
This did yield the users ID which I then stored in the variable used to query LDAP.
Once this is done, save the workflow as a snippet. I then brought it into a workflow where this query has to be made for as many people listed in a people/group field. You apply the collection variable and its related actions (i.e. 'for each') for every item in the collection variable.
In my Nintex 2010 sandbox site, I have a simple test workflow on a list that has a people field that only allows a single person chosen. the workflow uses multiple "Set variable" actions to leverage the user profile service in different ways. The output from the workflow can show anything that it finds the person's user profile. Here's a sample output from my test:
12/21/2015 11:56 AM Workflow Comment Distinguished name is CN=Jason Smith etc. etc. etc.
12/21/2015 11:56 AM Workflow Comment Name is Smith, Jason (US - State Name)
12/21/2015 11:56 AM Workflow Comment User Name is jsmith
12/21/2015 11:56 AM Workflow Comment First Name is Jason
12/21/2015 11:56 AM Workflow Comment Last Name is Smith
12/21/2015 11:56 AM Workflow Comment Account Name is "ourdomain\jsmith"
12/21/2015 11:56 AM Workflow Comment Job Title is
12/21/2015 11:56 AM Workflow Comment Department is "Our Department Name"
The Set variable actions will look something like this:
If we had a column that allowed multiple approvers and set a workflow variable to that column, then you'd need to use one of the mothods above to work with the output because it would look kind of like this: 511;#Smith, Jason (Atlanta);#816;#King, Mary (Atlanta)
For example, you can make a web service call to _vti_bin/usergroup.asmx "GetUserCollectionFromGroup" method that uses a SharePoint group name as input, and outputs to a multiple line of text variable. Then you would query the XML using the multiple line of text variable as input for the names that are contained in that SharePoint group.