Friday, July 25, 2014

SharePoint Designer 2013 Workflow Email Link To Edit Item or Display Item




In this post we will discuss how we can send a link to edit or display list item in SharePoint designer workflow email.

Here my requirement is When ever an item will be added to the list item, then an email will go to some specified user and the email should contain a link to view or edit the item. Once click on that the list item should open.

Also you can check out:

- Add Chart web part in SharePoint 2013

- Apply html to email template in SharePoint 2010 designer workflow

- Cross-site publishing in SharePoint Server 2013

Here if you will try to use URL Path of the Current Item then it will not work.

So follow below steps to achieve:

First Approach:
First of all create the workflow and then Add an action as "Send an Email". In that action click on "these users" and it will open the "Define E-mail Message" dialog box. There click on the Hyperlink symbol (highlighted in yellow) as shown in the fig below:


This will open the Edit HyperLink dialogbox. There in the "Text to display" write what you want to show, here I am putting "Click Here". In the Address click on fx as shown in the fig below:


That will open the lookup for String dialog box. There change the Data source to "Workflow Context" and Field from source to Current Item URL as shown in the fig below:


Now run the workflow and check the email when you will click in the link, it will open the list in Display mode. And the URL will come like below:

https://Hello.sharepoint.com/teams/MyTestSite/Lists/MyList/DispForm.aspx?ID=1

2nd Approach:
I have one requirement to open the item in Edit mode and you can follow this approach if you want. But the limitation in this approach is, here the URL is constant. Follow below steps:

First of all create the workflow and then Add an action as "Send an Email". In that action click on "these users" and it will open the "Define E-mail Message" dialog box. There click on the Hyperlink symbol (highlighted in yellow) as shown in the fig below:


This will open the Edit HyperLink dialog box, then click on ... as shown in the fig below:


This will open the StringBuilder dialog box. Here Put the URL like below and then click on Add or Change Lookup.
Edit URL: https://Hello.sharepoint.com/teams/MyTestSite/Lists/MyList/EditForm.aspx?ID=
Display URL: https://Hello.sharepoint.com/teams/MyTestSite/Lists/MyList/DispForm.aspx?ID=


This will open the Lookup for String dialog box. Here choose Data source as Current Item and Field from source as ID. and click on OK as shown in the fig below:


Now the URL should be like below:

Edit URL: https://Hello.sharepoint.com/teams/MyTestSite/Lists/MyList/EditForm.aspx?ID=[%CurrentItem:ID%]
Display URL: https://Hello.sharepoint.com/teams/MyTestSite/Lists/MyList/DispForm.aspx?ID=[%CurrentItem:ID%]


Now you can publish the URL and it should work. But here if you try to deploy the workflow into different site or list then you need to open the workflow and change the URL.

In this way the form can be opened in Display mode as well as Edit mode.


0 comments:

Post a Comment

Twitter Delicious Facebook Digg Favorites More