<Update: 2015-06-15> My colleague Joe Rodgers pointed out that the below steps do not work in SharePoint 2013 style workflows. As it turns out there was an issue with the link that was generated for the “Workflow Context: Current Item Url”. This issue is addressed in the SharePoint 2013 June 2014 CU (requires Service Pack 1 or the March 2013 PU). See below for more details.
</Update>
In this post I’ll walk you through the process of sending an email that contains a link to the current item from a SharePoint Designer 2010 workflow. This is a process that has been published on many other forums and blogs, but many that I have seen are more complex than seems necessary.
Problem
A common request from SharePoint users is to get an email which contains a link to review/approve/edit the workflow item. SharePoint list items contain an automatic property for Url Path, but unfortunately that Url is not properly formatted to retrieve the item if you include it directly on the message body. I tried a few solutions suggested from other blogs or forums that took a substring of the Url Path property, concatenated the display form view Url, and mixed in some other strings. While I was able to get this working in some scenarios I still had issues in general.
Solution
My solution involved adding a hyperlink to the message body. This ended up being far easier than I had expected and fairly intuitive once I found the correct property to use. Follow these steps to see what I did.
First add a “Send an Email” action to your workflow. Edit the action to pull up the email configuration dialog. Click the “Add hyperlink” button seen below.
When prompted for the address of the link click the fx button to perform a lookup. Choose Workflow Context from the “data source” dropdown. Choose Current Item URL from the “field from source” dropdown. Click OK.
Your Edit Hyperlink dialog should now look something like this.
The end result will be a hyperlink added to your email pointing to the current workflow item. Note: this link points to the non-modal dialog display form (display form similar to what you had in 2007).
SharePoint 2013 Considerations (update 2015-06-15)
If you attempt to use this process for SharePoint 2013 style workflows (based on Workflow Manager and not the out of the box SharePoint 2010 workflow engine) you will notice that the URL generated is incorrect (ex. “Lists/MyList/1_.00”). It will look something like the following.
The solution to this is to install the SharePoint 2013 June 2014 CU (I tested with the Server package but it may be included in the Foundation package as well). After you install this cumulative update you may notice that the URL generated only includes from the list level and down (ex. “LIsts/MyList/DispForm.aspx?ID=1). As such you will need to combine this with the site URL. See below for example of the new URL that is generated.
Conclusion
In this post I walked you through the steps to create a SharePoint Designer 2010 workflow with an email that contains a link to the current item. While there are many other options for accomplishing this out on the web I found this to be a more concise process and easy to understand. Hopefully you found this helpful as well. Feel free to leave any comments or feedback if you’ve found other ways that were helpful to you.
-Frog Out
Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#644784Great post. I’m getting a weird result: I set up a workflow to cc: recipients and the ID is different in each e-mail! For example, the first recipient gets a link with the correct item ID or URL, 510, which is correct and functions properly. The second and third recipients get a link to 511_.000 and 511, respectively. Neither of these links exist. It looks like SharePoint’s doing some logical operation in the background. Any idea how to thwart it so people who are cc’ed get the same link?
LikeLike
Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#645157Very useful post, thanks! I have a query though – suppose the email alert is being designed for new document additions to a library, how can I also add a link to the library itself (apart from a direct link to the document)? I can’t find a field in the workflow designer that links to the library name for the file in question.I’ve looked everywhere but haven’t found a solution for this as yet, hoping you can help!
LikeLike
Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#645323Why does MSFT make such simple things so complex? Thanks for the post – just what I needed.
LikeLike
Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#645685Awesome thanks!!!!!!
LikeLike
Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#645837THANK YOU SO MUCH!! Worked like a charm after lots of frustration. I’m using Office 365/SharePoint 2013, SharePoint Designer 2013. Perfect solution!
LikeLike
Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#646014first of all thank you for this post, i have a quick question for you, when i use “Workflow Context” as the data source and “Current item URL” in the Field from source, the link that is getting created is pointing to the display form (dispform.aspx?id=xyz) is there a way i can change the link to point to edit from instead of the display form? any help is greatly appreciated
LikeLike
Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#647126Thank You,You are awesome!!!
LikeLike
Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#647332Thank you for your help! I have been working on this issue for a wek and found your post!!Keep sharing :)M —
LikeLike
Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#647806You rock! I had been going crazy on that and my search came right to your solution which works perfectly.
LikeLike
Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#648237hi,Is there an option to reply to a sharepoint by email and for the workflow to change a variable status based on this reply?for instance- if the reply should be “approved” or “rejected” – can it use the word typed in the reply email to change a variable status in the workflow?thanks!
LikeLike
Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#648470Thank you!!!!!
LikeLike
Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#648948Thanks for posting this Brian! Still helping me years later!
LikeLike
Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#649320Thank you so much for this. Huge workflow finally works – just couldnt figure out to get this link.
LikeLike
Nicely done! Thanks for this. (Yes, some of us are *still* using 2010 workflows…)
LikeLike