locked
Workflow emails and URLs RRS feed

  • Question

  • Hi

    I've got a workflow sending out an email which contains a certain list field (which differs upon the data the user enters in the form). In this list field can be an URL pointing to a document in a document library in the same site. Similar to this:

    http://sharepoint/subsite/Shared%20Documents/document.pdf

    Now as soon as the workflow takes this list field and sends it in an email, the link is somehow converted to:

    /subsite/Shared%20Documents/document.pdf

    When checking the link directly in the original list item, it looks perfectly fine and is using the absolute URL (as seen when right clicking on the link and selecting "Properties"). Same when I edit the item and take a look at the HTML code, the <a href> tag is set correctly. But something in the way Sharepoint sends the email out of the workflow is stripping it down to a relative URL which then becomes unusable.

    Any idea what could cause this? I reckon that Sharepoint recognizes that the link points to an item on the same site, but why does it alter the URL? Links to external websites sent the same way are working perfectly fine.

    Could it be an issue with the particular sharepoint version? We're currently using 12.0.0.6504.

    Thanks and rgds

    Tuesday, June 21, 2011 11:42 AM

Answers

  • Hi Oliver,

    I reproduced your issue.
    When you copy a document link from your site and paste to a list field with the “Rich text/Enhanced rich text” format (in Multiple lines of text), it display an absolute URL but it is <a href =relative URL> in HTML code.
    So when you send an email the absolute URL (display name) is pointing to a relative URL actually.

    I suggest you change that list field (column) as “Plain text” format via the option in the “Multiple lines of text”.
    Then the document link should be the absolute URL in the email.

    Thanks & Regards,
    Daniel


    Regards,Daniel,Microsoft Contingent Staff
    • Marked as answer by Meet Again Friday, June 24, 2011 1:21 PM
    Friday, June 24, 2011 7:20 AM
    Moderator

All replies

  • Hi Meet Again,

    >>>When checking the link directly in the original list item, it looks perfectly fine and is using the absolute URL (as seen when right clicking on the link and selecting "Properties"). Same when I edit the item and take a look at the HTML code, the <a href> tag is set correctly.

    Could you tell me how did you get the doc link from another library and put it in this list item field?
    I assume that you do that via SharePoint Designer workflow, there are 2 types of URL link in the workflow Lookup, “URL Path”(relative URL) and “Encoded Absolute URL” (absolute URL). Their display names should be different, but both URLs are absolute URLs (pointing to the same file) through “Properties” and <a href>.

    When you send an email in a workflow and get the field value in Lookup, their links are different.
    “URL Path”: /subsite/Shared%20Documents/document.pdf
    “Encoded Absolute URL”: http://sharepoint/subsite/Shared%20Documents/document.pdf

    I suggest you check it and make sure the link is “Encoded Absolute URL” in the workflow
    Or you can construct an absolute link (http://sharepoint+relative URL) in your email:
    http://sharepoint[ListItemLinkField].


    Thanks & Regards,
    Daniel


    Regards, Daniel, Microsoft Contingent Staff
    Thursday, June 23, 2011 3:44 AM
    Moderator
  • Hi Daniel

    Many thanks for your reply.

    It's actually pretty simple, I'm not using any workflows to edit the original list item. I'm simply creating it manually, get the link to the document I need and paste that link into the list field.

    So the list field looks something like this:
    "Text [...]
    URL to a document
    [...]Further text"

    I then use the workflow to check which one of those already existing list items should be sent in the email. So the link is basically "hardcoded" directly in the list field and I'm doing a simple lookup to send this field in an email.

    Regards
    Oliver

    Thursday, June 23, 2011 11:01 AM
  • Hi Oliver,

    I reproduced your issue.
    When you copy a document link from your site and paste to a list field with the “Rich text/Enhanced rich text” format (in Multiple lines of text), it display an absolute URL but it is <a href =relative URL> in HTML code.
    So when you send an email the absolute URL (display name) is pointing to a relative URL actually.

    I suggest you change that list field (column) as “Plain text” format via the option in the “Multiple lines of text”.
    Then the document link should be the absolute URL in the email.

    Thanks & Regards,
    Daniel


    Regards,Daniel,Microsoft Contingent Staff
    • Marked as answer by Meet Again Friday, June 24, 2011 1:21 PM
    Friday, June 24, 2011 7:20 AM
    Moderator
  • Hi Daniel

    Many thanks for your reply, much appreciated.

    I'll give it a shot, probably needs some redesigning of the workflow / list items as I need some rich text formatting in the text itself. But I'm sure this will work nicely as a workaround.

    Regards
    Oliver

    Friday, June 24, 2011 1:24 PM