Recently I’ve been working with Microsoft Office SharePoint Server (MOSS) 2007. Since this is my first post on the topic I’d love to start at a high level about what it is and how it works, but let’s get to the interesting stuff: what doesn’t work well and how to get around it.
Specifically, this will be the first in a series regarding a deficiency in the workflow component of SharePoint that doesn’t allow you to send e-mail to multiple recipients from a multi-value column of a list using SharePoint Designer 2007 (SPD).
This first post will describe the problem, provide lots of screenshots so it can double as a fast introduction to workflows in SharePoint for the uninitiated, and then provide a quick hacky solution.
The Multi-Value Column Problem
Here’s how it should work. You create a list (e.g. Performance Review) and add a column (e.g. “Peers To Review”) and select a type of “Person or Group” with “Allow multiple selections” set to Yes.
(click any image to enlarge)
Now if you add a blank workflow in SharePoint Designer (from the SharePoint Content tab):
And you select the list you created (Performance Review):
Then you should be able to
- Add a “Send an Email” action
- View the message’s properties
- Select the recipient
- Add a function by clicking “Workflow Lookup”
- Select the Current Item (aka the current list item, which is like a row in a spreadsheet and in my example this would be the current performance review that the workflow is being run on)
- Then select the new column “Peers to Review”
But wait. Where’s your column? And here is the problem. The UI of SharePoint Designer filters out all columns that are marked with “Allow multiple selections.”
Simple Hacky Solution #1
Believe it or not the Workflow Engine knows how to send e-mail to a column with “Allow multiple selections” but it’s the SharePoint Designer UI that doesn’t. This means that a simple solution to the problem is this:
- Turn off “Allow multiple selections” for your column (note the warning “This will remove all person values except the first one”)
- Close and reopen the workflow in SharePoint Designer and follow steps above and magically your column will appear in the dropdown
- Finish creating your workflow
- Turn back on “Allow multiple selections”
- Create an item for the list and run the workflow you created in SharePoint Designer
And voila, it works! Both (or all) recipients have received an e-mail.
Sadly, this simple technique isn’t an acceptable solution for the long term. What happens if you want to change your workflow down the road? You may need to turn “Allow multiple selections” back off, thus deleting your multi-user data. A better solution is to create a custom action in Visual Studio and get it to plug into SharePoint Designer. And that will be the topic of my next post:
Note 1: this series is largely in response to the several users having similar problems at: http://forums.microsoft.com/MSDN/showpost.aspx?postid=1443799&siteid=1
Note 2: If you’re interested in the ERD for the topics in this SharePoint post this diagram might be useful to get you up to speed: