This article describes how to setup a SharePoint list so that each item in the list has a column to allow selection of multiple people to be notified initially when the item is created and also every time the item is subsequently updated or edited.
The scenario proposed to me recently went along these lines:
Do you know if there’s a way to add multiple people’s name/email to an item in a Sharepoint List? So maybe we’re tracking issues, and when the issue record is created, we want to tie 5-6 others to the record so they can be involved/aware in the updating of that record and/or the communications related to it…like a cc: list.
Allow me to embellish the requirements and scenario a little so we know the problem at hand…
We have a implemented a simple Helpdesk issue tracking system in SharePoint.
- The issues themselves are tracked as a single item in a SharePoint list
- A new list item is created for each issue
- Issues are primarily generated from an email received by one of the Helpdesk staff
- Often we want to keep multiple users informed of a particular issue when it is created and as it progresses
- We want a no code solution
Note: before we jump into the solution, the crux of the article is about achieving the cc: style notifications. I’m not advocating this as a recommended design for a Helpdesk system.
My first thoughts on this one was to simply add a multi-value Person/Group column to the list called “Notification List”, then create a view and set the filter on the view to where “Notification List” is equal to [Me]. Here’s one of many articles on how to use the [Me] filter. This works great and when you go to the view you just see the items where you are in the “Notification List”. I then thought it would be a simple task to create a SharePoint Alert on this list so that whenever someone creates or modifies an item in this list an alert notification email would get sent out. This all works fabulously if there is only ONE person in the “Notification List” column. As soon as you get multiple users in the “Notification List” column, the alerts just do not get triggered. The view filter works fine and shows the correct items when single or multiple names are entered, but it seems alerts play by a different set of rules.
Time for a different approach, enter workflows. Can we achieve a simple (no code) workflow to send the emails out? Sure we can. Here’s how it is done.
First create a custom list called “Issues”
Now add a people & groups column called “Notification List”. Ensure is accepts multiple values and I’m going to just allow people (not groups) to be selected.
While I’m creating columns I’ll create a few more just to make the scenario a little more realistic. I’ve added Description of Problem, Status, and Assigned To columns. Now when I create a new item in SharePoint my new form looks like this:
So now to the meat of our problem, how do we get SharePoint to send an email to everyone on the notification list when the item is initially saved, and then every time the item is edited?
We are going to have to create a workflow using SharePoint Designer. So let’s fire up SharePoint Designer and connect to the site that contains our list. Then select “Lists and Libraries” from the left navigation.
Open the Issues list and select List Workflow from the ribbon
Now provide a name and description for the workflow
Now add the “Send an Email” action from the Action ribbon button
Now click the Email these users link to define the email message.
- Click on the address book picker on the To:
- Select Workflow Lookup for a User…
- Set Data source to “Current Item”
- Set Field from source to “Notification List”
- Set Return field as “Email Addresses, Semicolon delimited”
Now you can specify a subject (using the function builder to include the Title of the issue) and the email body, again you can use columns from the issue item and include a hyperlink directly to the item.
Return to the workflow information page and set the triggers to automatically start this workflow when an item is created or changed.
All that’s left is it Save and Publish the workflow
We can now create a new item in SharePoint specifying some users on the Notification List.
When we save the item, people on the Notification List will automatically receive an email as shown below.
Now for the gold plating
Remember when we set the scenario that most issues are raised by an email being sent to a Helpdesk staff member (yes they can’t just create them in this list themselves!). What we really want is that email message (and any attachments it has) stored on the issue item as an attachment. This would be a bit tedious for someone to save the email as a file and then manually attach to the new SharePoint item. Enter OnePlaceMail (the Express edition is a free add-on to Outlook). Simply install OnePlaceMail on the Helpdesk users machine that has Outlook. You can now ‘bookmark’ the Issue list and it is available (yes the whole SharePoint list with full functionality) directly in Outlook just like it is an Outlook folder.
What is really awesome about this solution is when an email comes in that you need to create a new issue item for, you simply drag and drop the email to the Issues folder in Outlook and OnePlaceMail performs it’s magic and let’s you complete all the columns without leaving Outlook – no need to even open SharePoint in a browser!
The item is now created in SharePoint, the email message is stored as an .msg file attachment, all column values are set and notification emails have been sent out. You can even just click on the Issues folder in Outlook (that we dragged dropped the email to) to see it in SharePoint.
Further Reading (in response to comments on this post)
In response to Eugene’s comment here’s how to achieve inserting a URL link to the SharePoint item in the body of the email message that gets sent out by the workflow.
Please be aware that there is a fundamental different between SharePoint lists and SharePoint document libraries in the format (or syntax) of the URL required.
I’ll first go through creating a link to an item in a document library and then to an item in a list.
Insert URL Link to an Item in a SharePoint Document Library
Use the ‘insert hyperlink’ button to create the link in the body of the email
Provide the user friendly text to display such as ‘Open Item’
To build the address use the Fx button as we need to use some properties from the item currently the workflow is running on.
Set Data source to Current Item
Set Field from source to Encoded Absolute URL (this gives us the most portable URL that includes the server name and protocol with any special characters encoded which gives the URL the best chance of surviving being sent through email servers and arriving at the other end intact)
The hyperlink should now have an address of [%Current Item:Encoded Absolute URL%]
Click OK and your hyperlink to the item in SharePoint is done
Insert URL Link to an Item in a SharePoint List
You would expect the above technique would also work for list items but unfortunately it does not. It leaves you with a pretty useless URL in this format: http://server/site/Lists/listname/1_.000
The URL format that you need to link to a list item is:
http://server/site/lists/listname/DispForm.aspx?ID=xxxx (where xxx is the ID of your list item)
The simplest way to achieve this format is to supply the fixed portion of the URL and pull the ID portion dynamically. Your Hyperlink address would be something like this: