Recently, I worked on a Sharepoint project solution for our attorneys to be able to create projects and assign them to summer associates. When the project is completed, a workflow kicks in and sends an email to the responsible attorneys to let them know it is completed. In building the email, I ran into a problem with converting the user name of the assigned associate into their real name.
In the workflow built with Sharepoint Designer, I added a lookup field to the Subject line of the email. It came from the Current Item and the AssignedTo column. The email was sent and in the subject line the name was formatted “domain\username”. So, how do I convert the name?
After looking and looking for help, I found a wonderful open source solution for custom workflow activities on CodePlex. It has a nifty activity called “Lookup user info”. The lookup allows you to query a user profile property by their user name. (There is a screenshot of this on CodePlex) I am still amazed at how Microsoft doesn’t have this OOTB. Anyway, this wasn’t the end of the story.
I was interested in finding the real name of the user. In the query field, I put in “Name” which seemed logical coming from AD, but got nothing back. I realized it was looking for the Sharepoint version of the user properties. I then went to the next CodePlex tool, Stramit CAML Viewer. What an amazingly handy tool! I then looked up the User Information List under my root URL and found the real name was actually called “LinkTitle”. In the end with the help of a couple of tools, the email subject had the exact format I needed. It was “Evaluation form for actual name(LinkTitle)”.
IMHO, Sharepoint and SPD are great together. However, there are some vital integration pieces Microsoft left out. I shouldn’t have to go to Visual Studio or open source to convert an AD user name to their “friendly name”. AD is their product and they should build their products to FULLY integrate with each other in the easiest ways. That’s my 2 cents and maybe there is another way, but I haven’t found it yet.