Introduction

New functionality has been added in K2 4.6.4 to allow metadata to be preserved as well as to keep a SharePoint item’s version history.  This functionality has been added to the SharePoint List Items Wizard relating to the Copy and Update options in the wizard.  The same functionality has been added to the SharePoint Documents Wizard relating to the Copy, Move and Update options in the wizard. 

SharePoint List Items Wizard

Metadata can now be preserved when configuring the SharePoint List Items wizard on some of the available options in the wizard.  These options are:

  • Update List Item
  • Copy List Item

 

The Update List Item option now includes the option to preserve metadata for columns that are not selected to be updated, including the Created, By and Modified By columns.  The Copy List Item option includes the option to preserve metadata as well as to include the SharePoint items version history.

For more information on how to make use of this functionality, refer to the K2 Product Documentation.

SharePoint Documents Wizard

Metadata can now be preserved when configuring the SharePoint Documents wizard on some of the available options in the wizard.  These options are:

 

  • Update Document
  • Move Document
  • Copy Document

The Update Document option now includes the option to preserve metadata for columns that are not selected to be updated.  Both the Move Document and Copy Document options include the option to preserve metadata as well as to include the document’s version history if versioning is enabled on the library.

For more information on how to make use of this functionality, refer to the K2 Product Documentation.

 

Implementation of the functionality

The new functionality will be displayed in the respective wizards as per the images below:

Image

Image 1 – Preserve metadata that is not updated

Image

Image 2 – Preserve metadata and Include version history

Preserve Metadata

The Preserve metadata option can be used to preserve data for SharePoint columns such as Created By and Modified By.  Metadata for custom SharePoint columns can also be preserved in the event of copying or moving an item, only if the destination SharePoint List or Library contains the exact same columns and column names as the source SharePoint List or Library.

Note that when the Preserve metadata option is deselected, the data for the Modified By SharePoint column will revert back to the Service Account user for the relative SharePoint item.

Example: Preserve metadata that is not updated - Enabled:

In this example a SharePoint Custom List is used with the following columns and metadata:

Image


Using the SharePoint List Item Wizard to update an item, the Title column and TestColumnTwo was selected to be updated in a K2 process.  See the image below for results after running an instance of the process:    
Image                   

Note that the Modified By column was preserved as the Preserve metadata that is not updated option was enabled in the SharePoint List Item Wizard.

 

Include Version History

The Include Version History option will only be enabled for selection once the Preserve metadata option was selected.  This option will only function when versioning has been enabled for the SharePoint list or library.  Enabling this option will keep the SharePoint item’s version history when the item has been copied or moved to a different SharePoint List or Library.  If this option is deselected, the SharePoint items version history will revert back to the original version, for example 1.0.

 

Example: Preserve metadata and Include Version History - Enabled:

 

In this example a SharePoint Custom List is used with the following columns and metadata:

Image


Using the SharePoint List Item Wizard to copy an item to a different SharePoint List in a K2 process, the metadata will be preserved and the version history of the SharePoint List item will be included after running an instance of the process. See the image below for results after running an instance of the process:
Image

Note that the Created By and Modified By columns were preserved as the Preserve metadata option was enabled in the SharePoint List Item Wizard. The SharePoint List item version history was also included.

Important Considerations 

The following needs to be considered when making use of the new functionality:

  • This functionality is contained within the latest K2 update, 4.6.4. It will also be included in all future updates.  Install the update package to be able to make use of this new functionality.
  • For all new processes this functionality will be available.
  • In the K2 Designer for Visual Studio as well as K2 Studio, this functionality will be available to enable or disable in the respective wizards.
  • To make use of this functionality on existing processes in K2 Designer for Visual Studio and K2 Studio, update the design templates, rerun the respective wizards and configure accordingly.  Deploy the K2 process.
  • For the K2 Designer for SharePoint, this functionality is on by default for the respective wizards. There are no options available in the designer UI to enable or disable the functionality.
Note: If the Run As functionality is used on these events, with the Preserve metadata option enabled, the Run As user must have the following rights:
1. For SharePoint 2010 - SharePoint Site Collection Administrator.
2. For MOSS 2007 - Full Control on the SharePoint Site.

 

Recommendation
We recommend that the following updates are installed before making use of this new functionality:

1.  The SharePoint Cumulative Updates for August or later need to be installed on the SharePoint machine.
2.  The latest SharePoint Service Pack.