Appointment email Link, via SPD workflow

Last week on Stump the Panel, I put up a solution to the following question:

How to update a user’s calendar in Outlook using workflow

Since this seemed to be a popular post, I thought I’d show it to you, and also expound upon it, to show the nitty gritty of how it’s done.

Here’s how I got to the business solution.  The SharePoint “Employee Training” template allows you to add courses to a sharepoint calendar, and users can go to the site and register to take each course.  There are built in workflows, and one of them sends a confirmation email to the person when they register for the course.  So, I wanted the email to not only have a link to the event registration site, but to have a link that allows that registrant to immediately click to add the event to their own personal Outlook calendar.

The workflow already has a part with the “Send an email” action.  For you, if you’re looking at the same Employee Training template I’m looking at, you’ll want to open the “Attendee Registration” workflow, and then look at the first step of the workflow, where it says “Store This is a confirmation… in Variable: ConfirmationBody.  If you, the reader, are not specifically looking at this template, but want to try this out, just open a workflow and go into the “Send an email” action and follow along.

In the ConfirmationBody, the email body, you want the recipient to have a pretty little link, that when clicked, will open an Outlook appointment.  Where are you going to get the link, you ask?  Go ahead and go into any event item in any SharePoint calendar.  In the toolbar at the top of that item, you’ll see an “Export Event” button.  You’ll notice that when you click it, an Outlook meeting box pops up, will the info about that specific meeting.  This is the link that you want, so right-click on “Export Event”, and copy the link.  I’ll show you mine:

http://webappname/sites/sitename/_vti_bin/owssvr.dll?CS=109&Cmd=Display&List={6e63af05-7674-40bb-b487-ba9b01366708}&CacheControl=1&ID=8&Using=event.ics

We simply want this link to be included in the email to the recipient.  The way to make this link specific to the actual event ID of the relevent list item, will be to replace the ID=8 in the link, to be the ID of the current list item in the workflow.  Go ahead and delete the number after the ID= in your link, and click the <Add Lookup> button.croppercapture30

In this field, you’re looking up the ID field from the Courses calendar, and matching it up with the Course ID field in the Registrations list.

This is the full text of what I put in my workflow.  It not only includes a pretty “CLICK HERE” link, it also lets the user know that they’ll need to click “Save and Close” once the appointment opens.  Yes, you can use HTML in SharePoint Designer workflow emails.

If you would like to add this event to your Outlook calendar, <a href=”http://webappname/sites/sitename/_vti_bin/owssvr.dll?CS=109&Cmd=Display&List={ec72e475-45aa-4f06-83e0-855ec9ca94d4}&CacheControl=1&ID=[%Courses:ID%]&Using=event.ics”>CLICK HERE</a>, then click to Open, then Save & Close.

Just make sure that you use your own site’s URL in there, and don’t copy it from my site.  Yours will have the correct site URL and unique ID for your list.

From now on, when people register for events on your training site, they will be able to quickly and easily add that event to their own calendar.  Also, read more on the original question on Stump the Panel to see other people’s ideas.  Eric Alexander has written an entire blog series on modifications to the Employee Training template.  He also added a post to this stump the panel entry, about how to create a calculated column with a link to click to add the appointment to your calendar!!

25 comments

  • Wow! This is awesome stuff, very useful. I can see tons of uses for including an link to add to outlook calendars. Thanks!

  • Good stuff Laura. I just wanted to say our requirement needed the default toolbar removed which normally contains the iCal link. In order to recreate it, I noticed some funky behavior with the ID field in a calculated column. So I created a new field that is updayed with the items ID value on creation and the calculated column for the iCal uses this new number column as the reference to the item’s ID. I need to update my blog about that.

  • Thanks for the writeup Laura. I ran this workflow against a color coded calendar in MOSS and used a lookup in the body of the E-mail to dynamically populate the correct ID number. It sends a nicely formated E-mail with the link, allowing the user to open the cal item and save it to their personal Outlook calendar. Problem is though, if the date changes in the SharePoint calendar, how do I link it back to a personal calendar to reflect the date change. Maybe I should just put a ‘disclaimer’ at the bottom of my E-mail (Batteries not Included) Let me know if you have any ideas and thanks once again; Dave

  • kristina.dervin@pfizer.com

    Hi, when I try this, it is giving me a 3 hour offset. Meaning I set the calendar for an event at 12 pm and the appointment says the event starts at 3 pm

  • Kristina, Check the regional settings in your Site Settings in SharePoint. This is where the site’s time zone is set up. Make sure this is the same as the site users’ time zone. Note that when you change this, if the calendar already has appointments in it, you’ll have to go in and edit the time of all of them, to correct for the adjustment.

  • jo@owenreed.co.uk

    Hi Laura This post has been amazingly helpful to me. I am new to sharepoint and am slowly finding my way round but this post has answered another step that I was stuck with! The workflow I am encorporating this within is for vacation requests and so now the workflow initiates emails for approval and rejection of annual leave requests. Once the annual leave is approved, the employee is then sent a confirmation email advising them it has been approved and sending the link for them to add it to their outlook calendar (as explained for me here!). there is only one final step left to incorporate that I just cannot find a solution to and wonder if you have any advice. I also need to include a calculation where the workflow will check a list to obtain the respective employee’s remaining balance of vacation and then will subtract the total number of days they have requested to this figure and update it. do you have any suggestions on how to do this? I have searched your blog (and the internet!) but can’t find any solutions. Unfortunately, the link you have here to Eric Alexander’s website doesn’t work so I can’t check out his suggestions. I’d really appreciate any help you can offer. Many thanks Jo Owen Reed

  • Owen, Yep, take a look at my blog post here: http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?ID=65 This has a half-hour video of me showing how to do that exact thing. The example uses addition to add to a “number of trips”, but you can use subtraction to subtract from number of available days in your case. Still use “add” in the workflow action, but simply type a negative number in the number box, and it will be subtracted instead of added.

  • Thank you for the post this looks to be exactly what I need! I am having a problem getting the .ICS URL from SharePoint 2010. Can this be done in 2010? Thanks, Matt

  • Thanks for this great post. I just implemented it and I’m sure it will “wow” our users. 🙂

  • I followed the article word by word and still i am having some issues. Maybe it’s just me but the email has the link inside and it’s perfect but when i click the link it shows this http://xn--http-fb7a/wbappn/sitename3/_vti_bin/owssvr.dll?CS=109&Cmd=Display&List=%7bb4c99258-c4e0-4049-a38e-ba2bf46bd570%7d&CacheControl=1&ID=14&Using=event.ics“ That http://xn--http-fb7a should not be there but it keeps popping up in the url, when i click on the export link it works just fine and it’s the same url minus the Add look up. Any suggestions all help is appreciated.

  • Laura, This is great, do you know if there is a way to pass a reminder time along with this? It adds the appointment to the calendar but the reminder time is none. Thanks, Marc

  • Excellent !… Thnx for sharing this valuable information.

  • marc, No, there is not a way to do that (that I know of), but here’s a different post I wrote about sending a date reminder via workflow http://wonderlaura.com/2010/4/21/workflow-reminder-before-due-date-moss-vs-wss
    Jellis, I’m not sure, I’ve never seen that happen.

  • I have been successful in creating the .ics file to open an appointment using Laura’s code in the Employee Training template.

    My problem is even though the course name comes up correctly when the .ics appointment window opens, the date/time is set to the CURRENT date/time not the COURSE date/time. Reading other blogs I know others have experienced the same thing but I have not read of a solution yet. Please note that the variables for the course start/end time return correctly when I add them to the email body. I set the sharepoint site’s regional settings which is now correct. I also restarted IIS but these steps did not fix my problem.

    Laura, do you have any other thoughts as to what could be causing the course date/time to not display correctly?

  • Hi Jeanette,
    When you right click on the calendar item, is the date correct on that new calendar item that pops up? If that date is correct, then if you’re using that exact same URL for your email link, it doesn’t make sense that the date would then be gone.

  • My customer has requested to setup a supervisor approval for the Employee Training template.

    Please advise on how this can be done.

  • Laura, this is great, however when my workflow runs, it adds slashes into my listid everytime. So then after the first run, it stops working. Any idea why? Thanks.

  • Is the “Export Event” button a custom option for an event item? When I edit an existing event item, I don’t see the button. I asked a co-worker who is a bit more familiar with SP, and she said she’s never seen that either. Am I just completely missing something?
    I would LOVE to use this feature, so hoping someone can help me find the answer.
    Thanks 🙂

  • Jignesh,
    The simplest way would be to turn on the content approval setting on that calendar, and have the supervisor set up alerts so they get an email when someone adds something to the list.

    Kkerr,
    It adds slashes? Sorry, I don’t know what you mean, I’ve never seen that happen. What exactly does it look like?

    Monique,
    What version of SharePoint are you running? It looks different on each version.

  • I get to the Export Event button but there is no action when right clicking. How do I get the event link?

  • This was written for SharePoint 2007, and I’m not sure if it’s possible in other versions.

  • Thanks for this amazing post! I can confirm it also works in SharePoint 2010.

    The issue I’m having is that it does not pick up the proper dates and frequencies specified for recurring events.

    If you have any additional words of wisdom that might help, I’d appreciate any information you can provide!

    Thanks again

  • In SharePoint 2013, it keeps giving me the error ” Using brace character in an email that also contains a workflow lookup may corrupt the email and cause an unexpected results when the workflow runs.”.

    Any idea how I can get around this and include the event link in the email.

    Thank you!

  • Hi Laura,
    I need to add this feature but I can’t extract the link from that button. Do you have workaround for that?

    Thanks Sonia

  • Hi Laura, Thanks for wonderful solution. My question is that when we edit existing event in sharepoint calendar and it triggers email for outlook event then it always create a new event, it does not update existing event. Please suggest.

Leave a Reply