1,739 articles and 13,497 comments as of Sunday, October 24th, 2010

Tuesday, December 22, 2009

Building a Hyperlink in an Email with SharePoint Designer

Guest Author: Jim Bob Howard

For folks very new to SharePoint—and possibly HTML, I wanted to share a quick tip sending a link to a SharePoint item via email.

I’ll assume you either know how (or can look up on EndUserSharePoint.com) how to launch SharePoint Designer (SPD) and create a workflow. So, let’s start with adding the Send an Email action:

    1. Choose Send an Email from the Actions menu
    2. Click on "this message"

    3. Click ‘this message’ to configure the email

    4. In the body of the message, we want to add a link where the ‘[ ]‘ is located
    5. Replace the ‘[ ]‘ with ‘<a href=""></a>’ (without the single quotes)

    6. Screen clipping taken: 12/15/2009, 1:52 PM

    7. Point your browser to an item in your list (we’re going to copy and paste the URL here)
    8. Highlight the URL in your browser

    9. Highlight the URL in your browser

    10. Press Ctrl-C to copy the URL
    11. Toggle back to SPD and paste (Ctrl-V) the URL between the double quotes

    12. In your case, ’site,’ ’subsite,’ and ‘listname’ will be replaced by an address specific to your site.

    13. Highlight the ‘1′ at the end of the text you just pasted in
    14. Click Add Lookup to Body
    15. In the Field dropdown, choose ID, and click OK

    16. The ‘1′ at the end of the URL was highlighted before clicking Add Lookup to Body

    17. The next step is to put text inside the anchor tag (<a href="…"></a>). That’s what will be clickable in the email. I suggest using the Title field.
    18. Place your cursor just to the left of </a> and click Add Lookup to Body again
    19. This time, choose Title in the Field dropdown.

    20. Add text for the user to click on

    21. Click OK
    22. Add any other steps and actions you choose to the workflow and click Finish

Now, whenever a new item is created, the person who created it will receive a link to that specific item via email.

If you would prefer that they are taken to the item page in edit mode, simply replace DispForm.aspx with EditForm.aspx in the text you pasted in Step 7.

Jim Bob Howard

Jim Bob Howard

Guest Author: Jim Bob Howard
Jim Bob Howard is a web designer / web master in the healthcare industry. He has been working with SharePoint only since March 2009 and enjoys sharing what he has learned. You can email him at [email protected].

 

Please Join the Discussion

26 Responses to “Building a Hyperlink in an Email with SharePoint Designer”
  1. Donnie Darko says:

    Wow, simple HTML like we learned it 15 years ago! ;-)

  2. True. But “we” didn’t all learn it 15 years ago. ;)

  3. Donnie Darko says:

    I agree with you! :-) And godd for those, who didn´t know how it works! Thanks!

  4. Sanjay says:

    This does not work if the URL has spaces in it. For example if I’m embedding the user name(FirstName Last Name) dynamically then it comes as FirstNameLast Name in the URL, there is no space between the FirstName Last Name.

  5. Sanjay,

    I’m not quite sure what you mean by “embedding” the user name.

    If you are passing it as a querystring, and pulling the First Name and Last Name from your list item, then you can add a space by simply inserting “%20″ between the two fields when you build the URL.

    If that’s not what you mean, comment again and I’ll try to answer your specific dilemma.

    Blessings,
    Jim Bob

  6. Sanjay says:

    Hi Jim,

    Thanks for responding.. I cannot user “%20″ because my query strings comes dynamically(i.e. workflow variables). I will explain here to make this more clear:

    I will have the hyperlink in my SPD workflow email body as follows but query string values will come dynamically
    click here

    When user gets this in email, the link comes as follows:

    https://outlook.servername/owa/redir.aspx?C=da8c5df0fcc746f98145fffc467d0701&URL=https%3a%2f%2fservername%2ftest.aspx%3fQS1%3dtest%0user1%26QS2%3dtest+user2

    If you observe here in above link, th first space between test and user1 has been converted into “%0d%0″

    Now when user click on this, the browser converts this to
    https://servername/test.aspx?QS1=testuser1&QS2=test+user2

    So it removed the space between test and user1 for QS1 but QS2 works fine.

  7. Sanjay,

    Where are the workflow variables coming from? Are you sure you’re not getting ‘%0d%0a’? That would be a carriage return/line feed. If it’s coming a column, we might be able to strip those out and replace them with a true space, or %20.

    Blessings,
    Jim Bob

  8. sanjay says:

    Its a workflow variable set to user name using a custom workflow action..

    As this problem comes only for 1st query string variable. I did a workaround by making first query string variable as a dummy variable with space thenmy real query strings ..it worked fine.

    I think its a SPD workflow bug ..I saw some more query related to this in MSDN discussion fourms as well.

    Thanks for your help Jim ..

  9. Venkatesh says:

    Hi,
    I have added a link in the email content, to open a word document, when the user gets the mail. When the user clicks on the link, the user gets the username and password prompt. I want to disable user prompt while opening document.
    How to achieve this?
    Thank you

  10. Dear Venkatesh,

    I’m assuming this is a system-specific issue to your organization and/or the document they’re trying to open. If they’re not logged in to SharePoint (assuming the doc resides in a Document Library on SP), they may get that login prompt. Or, if there is some security system set up that prompts more regularly, that may be the culprit as well.

    Hope that helps (and sorry I couldn’t help more).

    Blessings,
    Jim Bob

  11. Brian says:

    I am following the directions, but when it comes to step 9, highlight the ‘1′, my URL for the form doesw not have a ‘1′. What should be done?

    Thanks,
    Brian

    • What does the URL look like past the last ‘/’ ?

      • Brian says:

        I’m sorry, I should have sent more. My URL does not look like the one in the instructions as far as including the .aspx file. I am not sure how to get to that. I am looking in both the Windows Explorer and SP Designer files trying to get that

      • The example given here in step 9 is only necessary if you need to feed the item’s ID into the URL. If your URL doesn’t look like this, then feeding it the ID won’t make any sense.

        For example, if rather than pointing to a specific detail page for an item, you want to point to the list itself… you don’t need to feed it the ID; just paste it as you find it in the brower location box.

        If that still isn’t clear, paste the URL here (without the HTML code around it) and I’ll see if I can point you in the right direction.

        Blessings,
        Jim Bob

      • Brian says:

        Thank you for your help.I think i am getting it. I was able to send a link in the email that would take me to the Edit Properties page of the form, But i was expecting to get the actual form itself.
        The form I setup was a Word document that was created using List Fields in SharePoint. I need the next person down the line to be able to see the form in Word, add info and save back to SP.

        I am not sure what you mean here, If that still isn’t clear, paste the URL here (without the HTML code around it) and I’ll see if I can point you in the right direction.

        Thanks,
        Brian

      • Then you most likely want to get the filename of the Word Document and supply that instead. In that case, try using the “Encoded Absolute URL” as your entire HREF string, rather than feeding the ID into it…

        Does that help?

        As for the example, I was asking if you could paste in the URL you are working with, which you are trying to modify and/or include in the email.

        Blessings,
        Jim Bob

      • Brian says:

        Jim,

        Thank you so much for helping.

        I tried the Encoded Absolute URL and did get it to work. I have a template in the Document Library. I start the process by creating a new form. I fill in the info that I need to. I save it. Then I do a workflow to send it to the next person to add info. My email in the workflow gives them a link to the document that I created and saved. When they add info and save it is saved back in my SP folder. So far it looks like it is working for me. I am just going to add some more workflows to send notifications and such.

        Your site gave me the info needed to get this going.

        Thank you,

        Brian L Shroyer

      • Brian says:

        One new thing. I am searching right now on your site. I want to be able to select the recipients of my document workflow from my Outlook contacts. So far i have only been able to apply a defualt or maybe type one. I want to be able to pull up a contact list and select as many as needed.
        Have you covered this topic? I am searching but if you can direct me to it that would be great.

        Thanks,
        Brian

      • Well, I must confess that this isn’t my site. It’s Mark Miller’s. I just one of dozens of authors here.

        As for using Outlook for email look-ups in a workflow, I believe Laura Rogers will be the person whose writing you’ll want to look for. Good luck!

        Blessings,
        Jim Bob

    • Brian,

      Do I have this right?

      You want the link to take the user directly to a document in a document library, right? Instead of a view of the list item, right?

      If so, try the Encoded Absolute URL and see if that will work for you instead (i.e. <a href=”[%ListName:Encoded Absolute URL %]“>Open document</a>. Another option would be to build the URL as you have, then add a ‘/’ and the [%ListName:File Name %], using the Add Lookup button.

      Blessings,
      Jim Bob

Trackbacks

Check out what others are saying about this post...
  1. Microsoft Banned from Selling Versions of Word; Obama Cyber Czar Choice Worries About Smartphones; Email Best Collaboration Tool?…

    Top News Stories Best Collaboration Tool: Email (Life Hacker) Last week we asked you to share your favorite…

  2. [...] Step 1. Since our Injury Report is a list that can execute a workflow, it’s easy to send an email to the user that includes a link to the BPE survey NewForm.aspx. But we also want to pass the ID of the Injury Report to the BPE survey and we can do that through the querystring. All we have to do is add "?ReportID=" and the Current Item’s ID field to the anchor tag’s HREF. (e.g. http://{site}/{subsite}/Lists/BPESurvey/NewForm.aspx?ReportID={ID}. If this isn’t clear, see my separate post on Building a Hyperlink in an Email in SPD.) [...]

  3. [...] Building a Hyperlink in an Email with SharePoint Designer [...]

  4. SharePoint Kaffeetasse 147…

    Office 2010 Video: Neuerungen in PowerPoint 2010, Teil 1 Video: PowerPoint 2010 Demo Teil 2 – PowerPoint…




Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!