21

Is it possible to go to the edit view of an sharepoint 2010 list item directly from email? I have a workflow that sends an email to a user to edit a list item. The link -at this time- takes them to the list. I would like for the link to take them to the edit view of that item. thanks,

10 Answers 10

20

Yes, you'd just need to craft a hyperlink to the edit form in the email body.

<a href="http://your.domain.com/sites/sitecollection/Lists/Tasks/EditForm.aspx?ID=[Add current item id here]">Edit item</a>.

Use the SPD interface to add in a workflow variable for the current item ID or task ID in the URL above where the [] are.

  • I've been using this approach, came looking for a solution with relative urls, please look at Webbie4 reply, as your post was selected as answer I think it might be very useful for others to mention it. – Yugo Aug 22 '17 at 13:39
  • Using relative URLs in an email may lead to unintended consequences, I've seen them try to open wrong sites, using absolute URLs would be preferred. – Eric Alexander Aug 27 '17 at 13:13
31

Use Sharepoint Designer:

In the body of the form "send an e-mail", find 'edit hyperlink' button in the upper right corner of the message.

for field address, click lookup for string or 'fx'

in Data Source, select “Workflow Context”. for field from source, select "Current Item URL".

Now Save, publish and test.

  • 2
    Nice find! I didn't know about "Workflow Context"->"Current Item URL". Way beter than creating the url by hand (as PirateEric suggest). – Dribbel Dec 19 '12 at 9:58
  • 3
    Unfortunately it doesn't answer the question, which is to link to the edit form. – Christophe Dec 12 '13 at 22:01
  • Ricardo Work Context : Current Item URL didn't work for me. It creates a hyperlink value of "list/listname/12.000" Instead of a URL. Am I missing something? – Angela French Jun 19 '14 at 21:24
  • Worked in SPO, thanks for this normally had to do the above answer, to copy the direct link for the site and adding the ID in the end, it worked but didn't allow for reusable workflows. Thank you! – Yugo Jun 5 '17 at 19:26
5

The following solution worked for me:

  1. In the body of the WorkFlow email, position yourself where you want the link to go
  2. Then click on the Edit Hyperlink button in the top right of the window
  3. In the address, paste in the URL to your EditForm for example: https://domain.sharepoint.com/Lists/mylistname/EditForm.aspx?ID=
  4. Then select the string builder button (...) to open the string builder window.
  5. In the string builder window position your cursor at the end of the line (just after ID=) then press the "Add or Change Lookup" button.
  6. Select Data Source = "Current Item" and Field from source = "ID"

Then ok that and save and publish.

  • 1
    Even though this is a good approach, the answer posted by Webbie4 aims for relative links, so wherever you deploy the solution it will work without having to manually go into the workflow and change the link. – Yugo Aug 22 '17 at 13:36
4

I have just found a rather simple, yet brilliant, solution here

Basically, in the hyperlink editor add the following:

[%Current Item:Encoded Absolute URL%]/../EditForm.aspx?ID=[%Current Item:ID%]
  • 1
    Please don't add the exact same answer to this question, as you did on this one. Instead, try to specify your answer further to make it a better of this specific question. Thank You! – Benny Skogberg Nov 25 '16 at 13:50
  • 1
    @BennySkogberg Having read the guidance here meta.stackexchange.com/questions/104227/…, I'm going to delete my other answer to the other question as I think this answer is more relevant to this question – Mark_Gibson Nov 25 '16 at 15:55
  • Awesome find!! Up you go. – Yugo Aug 21 '17 at 19:20
  • This is more portable, since it works even if the list has been renamed and you can tweak the solution slightly if you need to direct someone to the View or New forms. – Paul Rowe Dec 12 '18 at 14:55
0

you just set property in CreatTask

enter image description here

than after you can access listitemid like below

 int i = InvoiceApproverTask.TaskItemId;

string EditItemURL = workflowProperties.Web.Url.ToString() + "/" + workflowProperties.TaskList.RootFolder.Url + "/" + "EditForm.aspx?ID="+i;

Hops its helps someone..

0

The best I have found to get the URL is by using a combination of InfoPath formula and workflow variables

  • Create a custom InfoPath form. In the form, add a field call "ItemURL"

  • Using an InfoPath rules, set the value of the field to formula: SharePointListURL()

  • In SharePoint Designer, create a new workflow and add a workflow variable wfURL

  • Set the variable to field [ItemURL]

  • Set [ItemURL] = [Variable: wfURL]Item/editifs.aspx?ID=[Current Item: ID]

  • In the workflow, set the hyperlink to [Current Item: ItemURL]

The end result will a field containing the url to the edit form "http://YourSiteCollection/YourSubSite/Lists/Item/editifs.aspx?ID=[ItemID]

Works a charm, and it basically dynamic because if the list is moved, or the site collection is changed, the URL changes with it.

0

In the email add a link with this as the address [%TaskProcess:WebURL%]/[%TaskProcess:ItemURL%].

It opens the List Item (Document)

  • But not the edit form, right? I think the question at hand is how to create a link to the edit form. – Robert Lindgren Aug 4 '17 at 13:48
0

Following solution worked for me.

  1. First create a variable called URL-Item in SharePoint Designer. That variable should hold:

    a) link to your sharePoint list Instead of this format:

    http://br.com/Mordor/HR/Lists/Schulungsantrag/AllItems.aspx

    use this one

    http://br.com/Mordor/HR/Lists/Schulungsantrag/DispForm.aspx?ID=

    b) and next to it (in the same row) Current Item: ID

  2. Create Send an email action and in the email body part create a link based on the variable created earlier (s. the figure below). enter image description here

0

I recently implemented the solution to redirect to the edit form from the display form as presented by Andrew here: Include link to task in task notification email body

Works for both SP10 and SP13 Workflow tasks and solves the relative vs absolute linking problem as well.

-1

In SharePoint 2013 is possible to use this link path:

https://your.site.com/sites/sub/subsub/Lists/YourListName/EditForm.aspx?ID=[%Curent Item: ID%]&Source=https%3A%2F%2Fyour%2Esite%2Ecom%2Fsites%2Fsub%2Fsubsub%2FLists%2FYourListName%2FAllItems%2Easpx&ContentTypeId=[%Curent Item: Content Type ID%]

Modify to your path and the "AllItems" should be the name of your view. In my case, it worked fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.