none
Add Direct URL Link to List Record in Workflow Email Alert

    Question

  • I'm trying to figure out when you set up an email alert that you can put a direct URL link to the new or edited record instead of a link to the library.  I had this set up in 2007 and it worked fine, but can't get it to work in SPD 2010 and 2010 SP.

    When I create the link in the body of the email alert, I'm using this for the URL:

    http://myspsite.com/alf/_layouts/listform.aspx?PageType=4&ListId={A0A9DC87-D97D-4414-A2AB-8E0CBF561796}&ID=

    The reason why I'm using that is because when I went to the actual list library and right-clicked on the linked item, then copied the URL address, it copied as:

    http://myspsite.com/alf/_layouts/listform.aspx?PageType=4&ListId={A0A9DC87-D97D-4414-A2AB-8E0CBF561796}&ID=2&ContentTypeID=0x01004D03E84AED6F434392E493645A5A3752

    I removed everything after the "ID=" thinking that it would call up and display the record.  When I got the email alert and clicked on the link to view the record, this is what showed up:



    Can someone tell me how to do this so that when you click on the link in the email, it takes you directly to the new or edited record?

    Thanks.

    Mike Walton

    Sunday, July 21, 2013 11:15 AM

Answers

  • Hi Mike,

    You need to append the list item id to the URL, then you can access the specified list item via the URL with the specified item id (e.g. http://mysite.com/alf/Lists/test%20list/DispForm.aspx?ID=2), in workflow you can build the item URL with the Current Item Id via "Add or Change Lookup" button per the following article, the URL format is like this, http://mysite.com/alf/Lists/test%20list/DispForm.aspx?ID=[%Current Item:ID%], and use the same way for the EditForm.aspx page.

    http://sharepoint.indigoreality.com/2012/11/29/sharepoint-2010-url-to-list-item-in-workflow-e-mail/

    Thanks


    Daniel Yang
    TechNet Community Support

    Monday, July 22, 2013 6:58 AM
    Moderator

All replies

  • Mike,

    When you create a link to a list item — for example, an announcement or a calendar event — you can choose to have the link open either the display form (DispForm.aspx) or the edit form (EditForm.aspx) of the list item.

    To create a link that opens the list item for a document (instead of the document itself):

    1. In the browser, navigate to the Shared Document library.
    2. Open the list item for any existing document in the library, using View Item if you want your link to open the display form or Edit Item if you want your link to open the edit form.
    3. Copy the address in the address bar from the beginning http: or https: through the first equal sign (=), as shown in the following illustrations.

    Address bar showing display form address

    Address bar showing edit form address

    The ?ID= text is a query string parameter that instructs the page to display the form for whichever item in the current list or library has the list ID that follows the equal sign (=) — which in this example will be the list ID of the current item, as identified by the workflow lookup.

    In your case you will have to type in the entire URL of the list ending with /DispForm.aspx?ID=



    Daniel Christian (MCTS)

    Sunday, July 21, 2013 11:00 PM
  • Hi,

    Thanks for your reply.  I pretty much did everything you said and it still doesn't work.  First I created the click here alert in the email body:



    The URL I used was:

    http://mysite.com/alf/Lists/test%20list/DispForm.aspx?ID=

    I then saved the workflow and then republished it.  I then went to the list library and created a fake item:



    After I saved it you can see the record I just created here:



    I went to my email and the alert worked:



    But when I clicked on the Click here link, it still opens up the blank display form page:



    This is not what I want to happen.  What I want to happen is when you click on the Click Here in the email, it will open the new record - the Abe Lincoln record - that was just created, not the blank Display Form page.

    Please advise.

    Mike Walton

    Monday, July 22, 2013 12:19 AM
  • Hi Mike,

    You need to append the list item id to the URL, then you can access the specified list item via the URL with the specified item id (e.g. http://mysite.com/alf/Lists/test%20list/DispForm.aspx?ID=2), in workflow you can build the item URL with the Current Item Id via "Add or Change Lookup" button per the following article, the URL format is like this, http://mysite.com/alf/Lists/test%20list/DispForm.aspx?ID=[%Current Item:ID%], and use the same way for the EditForm.aspx page.

    http://sharepoint.indigoreality.com/2012/11/29/sharepoint-2010-url-to-list-item-in-workflow-e-mail/

    Thanks


    Daniel Yang
    TechNet Community Support

    Monday, July 22, 2013 6:58 AM
    Moderator
  • Hi,

    This worked absolutely perfectly!  Thanks so much.  One more question.

    I now have to do this exact same type of email alert only for a SP discussion board.  I followed your steps and got the full URL but it looks very different than the simple list item above.  Here is the full URL:

    http://mysite.com/alf/Lists/ALF%20Discussion/Flat.aspx?RootFolder=%2Falf%2FLists%2FALF%20Discussion%2FPayPal&FolderCTID=0x01200200F9BA105E6A79B647B1B8B6231F3FECA3

    PS - you'll notice in the above the topic of discussion is PayPal.

    So now I'm wondering where do I drop in that CURRENT ITEM > ID in the above so that when you click on the link in email it will take you to the current discussion board item?


    Mike Walton

    Monday, July 22, 2013 11:42 AM
  • I know this is a dead issue by now but just in case someone is searching for this:

    Lets assume this is your link:

    http://myspsite.com/alf/_layouts/listform.aspx?PageType=4&ListId={A0A9DC87-D97D-4414-A2AB-8E0CBF561796}&ID=2&ContentTypeID=0x01004D03E84AED6F434392E493645A5A3752

    You would paste that link into the string builder within the Workflow Designer.

    Then you would highlight the 2 next to  "ID=2" and before the "&ContentTypeID" part of the above link

    Then you would click the Add or Change Lookup Button

    Then you choose "ID" (make sure you are selecting this option withing "Current Item"

    Your new URL will look like this:

    http://myspsite.com/alf/_layouts/listform.aspx?PageType=4&ListId={A0A9DC87-D97D-4414-A2AB-8E0CBF561796}&ID=[%CurrentItem:ID%]ContentTypeID=0x01004D03E84AED6F434392E493645A5A3752

    When you click this link via your email it will take you to the open item as it is displayed on the default displayifs.aspx page.

    If you want to have this open an item for editing its pretty much the same thing. First go to your list, select the item (doesn't matter which we just want the link) and click "Edit Item", This will open the item via the editifs.aspx page/form. Copy that link and paste it in the string builder like in the above example. Then highlight the number after the "ID=" select Add or Change Lookup and insert the "ID"

    Now your link will open the item ready to be edited


    • Edited by GEE OTTO Wednesday, May 25, 2016 6:55 PM correction
    Wednesday, May 25, 2016 4:33 PM