Email a calendar/appointment link using SharePoint workflow

I am working on Employee Training template for a month now. We have customized a lot to suit our requirement. As we moved ahead few people in my team came up with a suggestion to email an appointment link using SharePoint Designer workflow. This was very crucial as people generally do registration but forget to export a calendar event in their outlook.

Open  Employee Training site in SharePoint Designer and navigate to workflows. There are 3 workflows -

  • Attendee Registration
  • Attendee Unregistration
  • Instructor Reminder

These workflows 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. Open ConfirmationBody by clicking it.

In the Confirmation Body, you need to show a link that will open an Outlook appointment.  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.  This is the link that you want, so right-click on “Export Event”, and copy the link. For example

http://myserver/sites/sitename/_vti_bin/owssvr.dll?CS=109&Cmd=Display&List={LIST-ID}&CacheControl=1&ID=2&Using=event.ics

We simply want this link to be included in the email.  The way to make this link specific to the actual event ID of the relevent list item, will be to replace the ID=2 in the link, to be the ID of the current list item in the workflow.  Delete the number after ID= in your link, and click “Add Lookup” button. This will open a window, 

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://myserver/sites/sitename/_vti_bin/owssvr.dll?CS=109&Cmd=Display&List={LIST-ID}&CacheControl=1&ID=[%Courses:ID%]&Using=event.ics”>CLICK HERE</a>, then click to Open, then Save & Close.

So now people will be able to open and save the event in their outlook calendar without having to export in from SharePoint site.

About these ads

40 thoughts on “Email a calendar/appointment link using SharePoint workflow

  1. When I make the changes, the link is emailed out but the event is not in the exported link. When the user clicks on “CLICK HERE”, it opens the calendar window but the class is not listed. It’s just a blank calander item. How do I get the class information to also export?

  2. Hi,
    I have implemented this..but the issue is that the timings of the class are saved in wrong inthe out look.

  3. Thanks Ameya, I figured out what I was doing wrong. I was in the wrong area of the workflow. Thanks for your response!

  4. Hi Ameya,

    Nice post.

    I implemented on the same line but i am stuck at one position. When user click on Click here link it opens up appointment in Outlook, but the data and timings of the course is coming as current date rather than actual date of course.

    Can you please let me know if i am doing anything wrong here?

    Thanks
    Shilpa

  5. Hi I have implement this but I am wondering if the abilitiy to set a “Reminder alert” is possible. The current method opens Outlook with teh corect date but I would like to set a reminder to be 1 hour before the event. When I use this method I find users don’t set reminders and the calendar option is saved but they are not alerted to the event.

    Thanks for you help

    • Charles you are correct. It will not setup a reminder option in outlook.
      You will have to execute code that will select this option every time the event is opened in outlook.

      Hope this helps.

  6. I also have this working but would like to set up the reminder for the event with a default value other than none. Where and how is the code executed? I am assuming this may not be easy. Thank you.

  7. I’m having the same problem as Shilpa. The calendar event opens with the current date and time instead of the event’s date and time. I am using Sharepoint 2010 and Outlook 2010. Did Shilpa ever get this resolved?

    • I doubt if Shilpa ever get it to work. Are the regional settings for the site correct?

      I think the workflow needs to be updated if that is the case. Could you debug the workflow and try to find out what date/time do you get in those parameters?

      if they are not being sent correctly to the workflow, it will break.

      Let me know your findings.

  8. I’m getting hung up on this tutorial. When I click on “export event” (which is not right-clickable for me by the way, using SP 2010) I don’t see any url paths, but it starts a .dll to prompt me to download a .ics file to use with outlook..

    any work around for this?

  9. Hi Ameya,

    I tried right-clicking on the Export Event button and do not get shortcut menu.

    So I tried your pasting method above and still cannot get this to work. It breaks when I paste your text (and edit to our site) at the {List} code.

    Therefore, when the link shows in the email all they see is CLICK HERE, then click to Open, then Save & Close

    is only shown as text.

    Do I just paste this into the body of the email or is it supposed to be set up somewhere else. Any help would be greatly appreciated.

  10. Hi All. I have been successful in creating the .ics file to open an appointment using Ameya’s code. I was not able to copy/paste code from the Export Event button since the button does not appear for me but was able to figure out how to modify her code.

    CLICK HERE, then click to Open, then Save & Close.

    My problem is the course name comes up correctly when the .ics file opens but the date/time is set to the CURRENT date/time not the COURSE date/time, as others have experienced. The variables for the course start/end time return correctly when I add them to the email body. I did have to set the sharepoint site’s regional settings and they are now correct. I also restarted IIS.

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

      • The regional settings are correct. The problem is that the “Export Event” button is missing. I’ve discovered that its due to the Courses list being a custom list rather than a calendar list. It comes this way from the template. Is there a way to convert a custom list into a calendar list?

      • You can create a calendar view from any list, but a “calendar” is different from a “custom list”. Think of them as different content types that derive from the same base type. The template is different.

        I know this form creating features back in the old days of SP2007, when you had to specify the Template ID for a list….Calendar is 106, and Generic List is 100.

        See http://joelblogs.co.uk/2011/06/16/sharepoint-2010-base-types-list-template-and-definition-ids-and-content-types-ids/

        The difference in the template ID indicates the features available to that list type are different..

        I don’t have direct experience with trying to change a list definition ID on an existing list. I suspect, though, that if it can be done, it might be easiest to do via PowerShell.

      • Thanks Jim. Your conclusions are the same as mine. The issue stems from the courses list being a custom list rather than a calendar list. In the old sharepoint 2007 templates the list is a calendar list and therefore the export button exists. if anyone knows of a solution or has a .wsp template where the courses list is a calendar list I’d be very appreciative. I really need that export button.

  11. sharepoint 2007 employee training template. how do you update the workflow if the location and date changes for the class? Employees are being sent reminder notifications for the original date and location, and does not show them the new date/location. This is confusing the persons who signed up and has become a huge issue, so any help would be greatly appreciated. Also I tried posting prior to this and not sure if it went through, so if it did, apologies for the duplication.
    Thanks so much, Jill

    Also we are going to upgrade to SP2010, does this template export/import easily? (sorry but VERY NEW to 2010)

    • Jill,

      You can add another workflow to the same list. This time the workflow triggering event will be list item change. So if you know how you can create a workflow in SharePoint Designer, this should solve your problem and the registered persons will be notified. Of-course you would need to design this workflow with proper inputs.

      http://sp2010teamplates.codeplex.com/ here you can find all such templates you can install.

      You can use the same content DB in your new SharePoint 2010 server. If you need any help around this let me know and I’ll get back to you.
      - Ameya

  12. Hello,

    I need this function, But the problem is When i open export event, and try to copy that link but in that link I dont have .ics . It’s just a link for webpage.
    Can you please tell me what to do ? what link do i need.

    Please reply
    It’s urgent.

    I am using sharepoint 2007.

  13. Hello there I am so excited I found your blog, I really found you by error, while I was
    looking on Digg for something else, Anyways I am here now and would just
    like to say many thanks for a fantastic post and a all
    round entertaining blog (I also love the theme/design), I don’t
    have time to browse it all at the moment but I have saved it and also added in your RSS feeds, so when
    I have time I will be back to read much more, Please do keep up the fantastic b.

  14. Hey there, I think your blog might be having browser
    compatibility issues. When I look at your blog site in Chrome, it looks fine
    but when opening in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up! Other then that, terrific blog!

  15. Hello Ameya, I have the same problem as shilpa and I already passed the parameters and they are right. So, I am not sure what’s missing. (I don’t think this makes any difference but one thing, I didn’t put the link in comfirmation body, I put it directly in the email because the email sent is not using confimation body variable)

  16. Reblogged this on @avisuj and commented:
    This is a great approach for using workflow to generate appointments. In combination with a custom workflow action (http://sharepointstuff.codeplex.com/), you can create workflows that email meeting requests.

    The owssvr.dll is available for libraries as well as lists. Unfortunately ICS generated from a document library do not have meaningful start/end dates. Since the dll cannot be directly modified, I’m considering creating an application page that would generate an ICS in javascript (A C# Example – http://webdevel.blogspot.com/2006/02/how-to-generate-icalendar-file-aspnetc.html).

  17. This works great when using a SharePoint calendar however if you are using a normal list use the following fields:

    Title
    Description
    Location
    And two new columns that MUST be called EventDate (for the start date and time) and EndDate (for the appt end date and time)

    then the ics url will pick up the correct dates and times.

    I found the answer here: http://binduchinnasamy.blogspot.co.uk/2012/07/generate-outlook-ics-file-from.html#!/2012/07/generate-outlook-ics-file-from.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s