Get Full Name in SharePoint Designer workflow

Every so often I keep seeing questions about parsing Full Name of a user in SPD workflows.

Sometimes we need to get the full name of a user – for example the name of an employee who submitted a Purchase Order request so it can be used in an email to PO approver, the name of a user who modified a document if we track item modifications in a log etc.. The problem is SPD returns username rather than the actual full name. Using the SPD-returned value in emails, logs etc. will almost invariably result in your users getting confused and demanding that a proper name is used. This is understandable as, unless you are have some IT knowledge, receiving an email containing a line similar to the ones below can be rather baffling.

company\go has logged a new purchase order”  (regular domain\username format)

or

“ the item was modified by myadmembershipprovider:go@company.com”  (format often seen in environments where custom authentication provider is used).

Solution:

Use Paul Kotlyar’s Lookup User Info custom SPD workflow activity from CodePlex

Once the solution has been installed, a new workflow action will appear in the Actions drop-down list in SPD. The one you want to use is lookup site user property.

The  Full Name property for a given user is LinkTitle (see screenshot below)

GetFullName

The action above will check an item’s Modified By property and return the full name of the user who last edited the item. For example, instead of company\js you’ll now get a much more user-friendly Joe Smith.

Note:

You can also use the lookup site user property action to parse other information about the user – e.g. the user’s Manager, department, phone number, ID etc. I will blog about it soon.

15 Responses

  1. What a great idea,
    Would did you like tell me the properties to get the user’s Manager, department, phone number etc. thanks.

  2. I am just curious how you installed this utility. I tried and when i opened my designer I saw the “Lookup user Info” in my action drop down but when I clicked on it, the action would not add. Do you have any ideas?

    • Found this over onthe codeplex site
      you have to add the follwong tag to the webconfig
      (in the authorized types section)

      • oops the blog striped the tags

        open
        authorizedType Assembly=”DP.Sharepoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0298457208daed83″ Namespace=”DP.Sharepoint.Workflow” TypeName=”*” Authorized=”True”
        close

  3. Jenn,

    I’m not sure why you’re experiencing the issue – I’ve installed the solution on a few servers and never had any problems. Visit the discussions page for the project ( http://www.codeplex.com/SPDActivities/Thread/List.aspx ) – I remember seeing a few threads about installation problems. Hopefully, that should help in troubleshooting your deployment.

    He,
    Have a look at the discussion page for this specific activity ( http://www.codeplex.com/SPDActivities/Wiki/View.aspx?title=Lookup%20user%20info&referringTitle=Home ). It lists a few other properties you can query using the custom action. Also, you can add additional columns to your users information list (e.g. UserID, OfficeLocation) and use the column names in your workflows. Very powerful.

    Hope this helps,
    Greg

  4. Greg,
    Thank your very much !!!

  5. Greg,

    Not having any experience with custom actions, I need your help.

    How do I pull up the list of associated properties like first name, last name, company.

    I’m able to add the action Lookup Site User Property, but when I try to pull up the user properties, I’m don’t see the correct source that’s linked to the active directory – only the current site (libraries, lists, workflow data…)

    I would appreciate any help you can provide.

    Thanks,
    Mike

    • Not sure if I understand you correctly but if you expect all possible property names (e.g. LastName, Manager etc.) to be automatically pre-populated and selectable from within the action itself that’s not how it works, I’m afraid. You need to type in the name of the property you’re after manually (e.g. in my example I typed in LinkTitle to get the FullName property). Look through my previous comment above for more details.

      Good luck,
      Greg

  6. Greg – you did help, thank you very much. I didn’t think it could be a simple as just entering LinkTitle, but it was. Now, the emails I’ve got our workflow sending look 100% better. Thanks! Have a good weekend.

  7. I got a warning says

    The Windows SharePoint Services Timer services is NOT started.

    when i tried to install this on my Windows Server 2003 machine.

    any suggestion?

    thanks!

  8. Hi Greg,

    Thanks for sharing! I tried out your solution and it worked! However notice that it works only if a single user is selected. If an assigned to field has more than one user, the full name is not displayed in the email. Is there any solutions/suggestions for this?

    • Hi Lynn,

      I haven’t been able to get this to work with Person or Group fields that allow multiple selections. I guess the SPD activity is coded to parse user ID and other parameters from a “standard” (single user) person or group field.

      For a single user the field format is ;#.

      For multiple users it is ;#;#;#;#;#etc.

      I guess the parsing procedure is not coded to allow for multiple users.

      You may log a request for this functionality to be included in the next release on the Codeplex page for the Custom SPD Activities project.
      Greg

  9. Here are the correct user properties to use with this workflow:

    http://ktskumar.wordpress.com/2009/03/11/wss-user-information-list/

Leave a Reply