Synchronizing SharePoint tasks with Outlook including categories

Recently one of our customers requested a SharePoint task list that is synchronized with Outlook. That is usually quite easy, but in this case we should have provided a way to tag the tasks and group them based on this multi-value property on the Outlook side, similarly to the default Categories field feature.

As you may know, only a limited set of task properties are synchronized between SharePoint and Outlook, but details –  like what exactly these properties are and how the synchronization process works – are not very well documented.

To investigate the behavior I’ve created a test list called OLTasks based on the Tasks list template in SharePoint.

image

Then connected the list to Outlook.

image

I’ve started Fiddler and found that the Lists web service is used for synchronization. First, the GetList method is called.

image

Next, a GetListItemChangesSinceToken request is sent. This method is suggested by Microsoft for item synchronization. As one can read on MSDN:

“The most efficient way to synchronize third-party clients with Microsoft SharePoint Foundation 2010 is to download only those items that have changed since the last synchronization occurred. You can do this in SharePoint Foundation 2010 by calling the GetListItemChangesSinceToken Web method.”

The first request contains no token, and the response includes the entire list schema (not shown below). Since our task list contains no item, the ItemCount is zero.

image

Note, that the request above contains the Categories property, however, our Task content type has no such field.

image

I’ve created a new task item in the list to see how it is downloaded to Outlook.

image

image

Again, the GetListItemChangesSinceToken method was called, in this case there was a token in the request (changeToken is not shown below due to lack of space) and the value of ItemCount was 1 in response.

image 

After synchronization, the item appeared in Outlook:

image

image

I’ve modified the task description, and found that on the next synchronization the UpdateListItems method was called to upload changes to SharePoint.

image

Before and after calling the UpdateListItems method the GetListItemChangesSinceToken method was called to detect possible conflicts and synchronize back changes from server.

To provide the Categories field for our tasks, I’ve added the existing site column with the same name to the list.

image

image 

Set a test value for the field at the existing task,

image

and created a new one with other test values. Note, that I’ve specified two values in this case, separated by a comma.

image

As expected the values are synchronized down to Outlook, as shown in this view, grouped by the Categories field.

image

When opening Task 2, we found that our category values are not in the Master Category List.

image

We can resolve it – and add some color codes as well – by clicking New… on the dialog box.

image

After this configuration, Outlook handles our categories as known ones. Next, I’ve set a new category for the task in Outlook.

image

The Outlook view reflects the changes.

image

The UpdateListItems method uploads the changes to SharePoint.

image

And the updated values are displayed in our SharePoint list as well.

image

I hope this quick guide helps you to better understand the default synchronization process, and to utilize similar techniques in your applications.

Advertisement

Tags: , ,

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 )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

Join 31 other followers