My 2p about ERP Solutions, Information Worker Solutions and other software products (mainly Microsoft Dynamics AX and Microsoft SharePoint).

10 November 2008

Lookup user info in a Workflow

by Patrik Luca 7 comments


Business Requirement: Use the Name user property in an Email sent out by a Workflow

Suppose following scenario: you have created a site based on the Help Desk template, one of the Application Templates for Windows SharePoint Services 3.0. With Microsoft Office SharePoint Designer 2007, you have added a Workflow to the Service Requests list which sends out an email each time a service request is changed to the Service Representative.

Problem is that the user information in the email will be the Account, though you would prefer to have the Name in the email.

Solution: Use the Useful Sharepoint Designer Custom Workflow Activities solution

The Useful Sharepoint Designer Custom Workflow Activities solution adds some Workflow activities to the ones out of the box. One interesting activity is the one to lookup user info. This activity can be used to have the Name in the sent email in stead of the Account.

To achieve this, follow the next steps:
  1. Add the Useful Sharepoint Designer Custom Workflow Activities solution to the SharePoint solution store. A nice wizard will guide you through the setup process.

  2. Go to SharePoint Central Administration->Application Management->Manage Web Application Features and activate the Useful Sharepoint Designer Activities feature.

  3. In Microsoft Office SharePoint Designer 2007, open up your previously created Workflow (double-click the .xoml file).

  4. Add two variables UserNameServiceRep and UserNameModifiedBy to your Workflow: it will be used to store the Name of both user accounts in the Workflow.

  5. Add two Lookup site user property Actions (this is an Action which is added by the solution Useful Sharepoint Designer Custom Workflow Activities) to the workflow before the Action Send an Email. Lookup the user property LinkTitle for the users Service Representative and Modified By. Store the values in the previously created Workflow variables UserNameServiceRep and UserNameModifiedBy.

  6. Edit the body of the Email as such that the content of the previously created variables is used in stead of the content of the fields in the Service Request.

  7. Click the Finish button in the Workflow wizard: a new version for your Workflow will be created.

If you now edit a Service Request, you'll have the Name nicely in the sent Email in stead of the Account. In the same way you could add other User Information fields to the sent out Email.

Comments 7 comments
Wade'r said...

I get ???? when I type in LinkTitle into the property name. Should I see LinkTitle as as choice or do I have to type it in the txt field?

Patrik Luca said...

Hi Wade'r,

did you try it out on a newly created item? Or did the item exist already before you've created/modified the workflow with the LinkTitle modification in it?

Anonymous said...

I added a Person column called "supervisor" to my user information. I then added "supervisor" as a CC in an email in my workflow. When it sends out an email it puts 23; #supervisor's name in the CC. Any idea what my problem is?

Rox said...

I am having an issue with the add-on. When I add it to my site, the "initiate when item is created" functionality breaks. Using MOSS 2007. Workflow can still be initiated manually, but the creation and update events are not kicking off the workflow. Has anyone else had this problem?

Clipping Path Service said...

A great tutorial where one can get a instant knowledge from.Thanks so much for these wonderful sharing.

Noah Larsen said...

Images Retouch is a professional Clipping Path Service Company and provides Clipping Path Services, Images Retouching Services and more for additional details

Kevin Rymer said...

I'm having trouble locating the "Lookup User Site Property" from the list of Workflow Actions. This action does not appear in my list, even when I expand it. I'm using SP Designer 2007

Patrik Luca, Ieper, BELGIUM
Feel free to use or spread all of the content on my blog. In return, linking back to my blog would be greatly appreciated. All my posts and articles are provided "AS IS" with no warranties.

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe feeds rss Most Read Entries

Subscribe feeds rss Recent Entries


Recommended Books

Subscribe feeds rss Recent Comments

This Blog is part of the U Comment I Follow movement in blogosphere. Means the comment field of this blog is made DOFOLLOW. Spam wont be tolerated.

Blog Archive

My Blog List