SharePoint Designer 2010 Workflow Email Link To Item

<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.

EmailLink1

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.

EmailLink2

Your Edit Hyperlink dialog should now look something like this.

EmailLink3

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).

EmailLink4

 

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.

EmailLinkWFItem2013_3_thumb[1]

 

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.

EmailLinkWFItem2013_4_thumb

 

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

114 thoughts on “SharePoint Designer 2010 Workflow Email Link To Item

  1. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#590803Thanx for the tip! The URL is placed as expected … One question/issue…. The List Name has a space in it .. “Trouble Ticket”When the URL is put into the email, the space breaks up the hyperlink of the URL and breaks it … No %20 is placed in the link name to account for the space…Any way around this? Jeff

    Like

  2. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#591816Poled,If you want to use another list you will lose the “Current Item URL” context. Instead you will need to build the URL manually / semi-manually. Read through this forum post for help on how to do that.http://social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/thread/333909e5-da8f-4d91-adb1-02a525553a0e

    Like

  3. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#595637What if the ID you are trying to retrieve is from the task list? I have a workflow that is attached to a form library. When a form is submitted to the library it kicks off a task item. I want to include a URL to that task item in the email that is sent out in the form library workflow. All the blogs and suggestions I have read is based on the workflow running on the Task List, so the ID lookup is automatically inherited. Do you know how to get the ID in my situation? I have been hitting my head on the wall about how to get this done. Also, a concern that i have is that even if I get it done, will there be a sychronization issue since I notice the workflow fires of the email immediately even before the task item is created?Thanks,

    Like

  4. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#595941Arnel,You could create 2 workflows. The first workflow runs on your form list and creates an item in the tasks list. The second workflow could then run on the tasks list when an item is created. The task list workflow would use the emailing functionality described in this post to send out a URL to the task item. This should also take care of the issue with the task item existing before sending an email.

    Like

  5. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#596783Do you know of any way to make the link use the modal popup version of the form?I also notice that when you select “Close” at the bottom of the item after following the link, you automatically go to the “All Items” view of the list the item came from. Any idea how to make it go to one of the other created views instead? Is it simply whichever view is set as the default view?

    Like

  6. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#597906Hey thanks for the tip.Now i am stoned. I need to add an image into the email that the workflow is generating and sending as part of the notification process.I have tried using the Advanced Features of “Send An Email” action to embed the image source in Sharepoint Designer 2010 all to no avail.Any help as to how I could achieve that?

    Like

  7. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#599756Martin,The instructions I posted were tested against a custom list. Did you implement yours on a forms library? Sounds to me like what you are seeing. In order to view forms through the browser you must have SharePoint Enterprise and configure InfoPath Forms Server service running. Also your form must be browser enabled. Let me know if that is not the case.

    Like

  8. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#608419Hi, the current URL will link the internal address, any ideas how can I create a hyperlink that will have the same structure but have the link use our extranet address?So for example it’s currently http://<servername>/sites/department/document library when it I want it to display http://<external access name>/sites/department/document library.Thanks

    Like

  9. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#608796Fawaz,Using the above described process I don’t believe it is possible to use the external (alternate access mapping) URL. You could create a custom SPD workflow action in Visual Studio, deploy to your farm, and then use that step in SharePoint Designer workflow to grab the external AAM URL. That would require a bit more development and configuration though.

    Like

  10. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#611169Peter,Are you using Alternate Access Mappings (AAMs) in your farm? It sounds like you have multiple zones configured and the default zone (ntlm) is being used instead of an intranet / custom zone. See my comment to Fawaz above. You would either need to change your AAM zones or create a custom solution to pull a specific zone rather than the default. Hope that helps.

    Like

  11. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#612151Hi Brain,Thank you for your article, saved me alot of research time and headache. However there is one issue i am seeing using the CurrentItemURL. One of our wf is set to run when an item is created, and instead of linking direcly to the Current item’s URL like the string says, it opens the allitems.aspx view. I tried a few instances and the same thing keeps happening. Any ideas/suggestions. Thank you for your help, really appreciate it. – Karan

    Like

  12. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#615056Tom, You can add additional info in the body by building a custom string with the Add or Change Lookup button. Inside that you can use a formula to reference other object properties such as start/end date, etc.Tim / Irfan, For accept or reject buttons you would be better suited using an out of the box approval workflow. You can even modify these with SharePoint Designer 2010 if they need tweaking.Janine, Not sure I understand you question. Have you replaced your default item forms (.aspx pages) with InfoPath forms? When I tested this I was using the default ASPX pages so I did not see any InfoPath. If you have browser enabled forms though you shouldn’t need to have InfoPath on the client.

    Like

  13. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#615101Thank you for this article, it has helped immensely with my current project.Slightly related, I have a current stumbling point which I am hoping someone might be able to help with.In addition to adding the email link to an item, I would also like to add into my text the name of the subsite that the email is being generated from (I have multiple similar subsites, and would like to be able to distinguish within the email text which one is generating the email to help the end user process the information).Is it possible to add the subsite name?Thanks,–Ben–

    Like

  14. Originally posted on: https://briantjackett.com/archive/2011/02/18/sharepoint-designer-2010-email-link-to-item.aspx#615113To create a hyperlink back to a Form Library and have the InfoPath form open in the browser, you still use the hyperlink button however you will need to copy the URL from a form in the library opened in the browser. You then replace part of the URL with the Encoded Absolute URL. See sample: http:/myserver.com/site/Library/_layouts/FormServer.aspx?xmlLocation=[%CurrentItem:EncodedAbsoluteURL%]&DefaultItemOpen=1

    Like

Leave a reply to Fawaz Cancel reply