in SharePoint 2010

SharePoint 2010: Lists.GetListItemChangesWithKnowledge Method

SharePoint 2010 has its own sync provider built in which is consumed by other client applications such as SharePoint Workspace 2010. You can read the case study here.


Microsoft Uses Sync Framework to Create New Collaboration Solution

As Microsoft, the world leader in software for personal and business computing, prepared the next version of its Microsoft® Office suite of desktop applications it wanted to combine the functionality of two of its most popular collaboration tools: Microsoft SharePoint® Server and Microsoft Groove®. The company’s development teams, however, faced the challenge of handling data synchronization to ensure version control. They found the technology they needed with the Microsoft Sync Framework, a technology developed by the Microsoft Sync Framework group, which is part of the Microsoft SQL Azure™ team. The result is Microsoft SharePoint Workspace 2010, which provides the rich user experience of a desktop application, with the Sync Framework handling data synchronization with sites created using SharePoint Server 2010.


As a developer if you want to make use of this in-built sync framework to build your SharePoint client applications, you can do so! Let me introduce to the new Lists.asmx method: GetListItemChangesWithKnowledge. This method returns all of the list items that meet specified criteria and that have changed since the date-time specified in the knowledge parameter for the specified list. You can read this blog post to know more about the sync knowledge.


GetListItemChangesWithKnowledge Usage:


To use this method, you need to add reference to the Lists.asmx web service to your application: http://<site-name>/_vti_bin/Lists.asmx


After that you can use the method as follows:


using (Lists list = new Lists())
  list.Credentials = new NetworkCredential("username", "password", "domain");

  changedItems = listTLA.GetListItemChangesWithKnowledge("Projects", null, null, null, 
                                                          null, null, null, null, null);


You can pass null for every parameter except for the first one which is the name of the list. As you can see we are passing null for the sync knowledge too. Initially, we can pass to get all the items (which are new). The method will also return the sync knowledge which then you can use for the subsequent calls. Below is an example of what we get back the first time:


<Changes xmlns="">
        <sync:syncKnowledge xmlns= 
                <replicaIdFormat sync:isVariable="false" sync:maxLength="16" />
                <itemIdFormat sync:isVariable="false" sync:maxLength="16" />
                <changeUnitIdFormat sync:isVariable="false" sync:maxLength="1" />
                <replicaKeyMapEntry sync:replicaId="jeJVN1EeT3Sn+NBWZOmqoA==" sync:replicaKey="0" />
                <clockVectorElement sync:replicaKey="0" sync:tickCount="1589" />
<rs:data ItemCount="1" xmlns:rs="urn:schemas-microsoft-com:rowset">
    <z:row ows_Attachments="0"
           ows_LinkTitle="Kim Abercrombie"
           ows_JobTitle="Test Lead"
           ows_Project="1;#Writing more sample code"
           ows_Title="Kim Abercrombie"
           xmlns:z="#RowsetSchema" />



As you can see, the sync knowledge associated is the sync:syncKnowledge parameter. You can use this parameter from now on to get updates on this list by passing it into the GetListItemChangesWithKnowledge method.


If you had a delete, the returned XML will look like:


<Changes ServerTime="20100421 10:35:49">
    <Id ChangeType="Delete" ServerChangeUnit="{E5C5E20A-5A9F-406C-B9F6-28923750CECD}:3510" 
            <sync:syncKnowledge xmlns= 


You can get the Delete event under the Changes parameter.


In the coming weeks, I will be blogging on building a SharePoint 2010 sync client application using the GetListItemChangesWithKnowledge method.

Write a Comment


Time limit is exhausted. Please reload the CAPTCHA.

  1. I know it’s been a while from this post, but do you in any chance have any working sample for sync? My confusion starts with custom sync provider proxy that has to be written in order to work against sharepoint data (which is, in itself, solution for the problem) – what are the methods which have to be implemented, and how those methods map to sharepoint web services. on client side, situation is clear, as locally file sync provider can be used.