10/14/17

SharePoint 2013 Move Documents to Another Library Using Content Organizer Web Service

A common task for document management system is to move a document from one library to another based on a particular condition or content type. To enable this feature, SharePoint provides some core actions that can let you copy the document to another site collection and then delete it from the source. 



In our case, we want to be able to move the document using a more complex action called Send Document to Repository which moves a document by using the Content Organizer Web Service.

Note:  Content type enables us to organize documents and associate them to content rules which can enable us to route documents to specific document libraries.

Configure the Content Organizer Feature

This core action enables us to move a document to another library within the same site collection using a SharePoint web service named Official File. In order to enable this web service endpoint, we need to enable a site feature and configure some content rules.

We first activate this feature by visiting this page:
  • Click on site setting
  • Click on site features
  • Look for Content Organizer and activate this feature

Content Organizer Rules
Create metadata based rules that move content submitted to this site to the correct library or folder.


This enables the web service that we can use to move the document. The end point is found at a location relative to your site collection for example:

_vti_bin/OfficialFile.asmx  or  sites/demo/_vti_bin/OfficialFile.asmx

Note:  We use this address when we add the workflow action.

This web service address can also be found by visiting the following page: 
  • Site Settings
  • Under Site Administration select Content Organizer Settings

Create the Content Rule

Now that the service is available to the site collection, we need to configure a rule that indicates what type of content type we want to manage and to what library we need to send this content. This is done by visiting the following page:
  • Site Settings
  • Under Site Administration select Content Organizer Rules


We want a rule for the Document content type, and we want to send the document to the ArchiveLibray.  As we can see, here we could route documents based on custom content types to other libraries.

Note: When using custom content types, we can have a more granular set of rules to send documents to other libraries that are based on that content type.

Workflow Send to Document Repository Action

We have now setup all the requirements to be able to send or move our document to another location.  We can now add a workflow using SharePoint Designer.  On our first step, we want to add the Send Document to Repository action.

Note: SharePoint 2010 Workflows provide this action.


This workflow action has three parameters

Parameter

Description
This action
This allows us to indicate to copy or move the document.

This destination content organizer
This is needed to indicate where the web service is located. Use the address that was identified on the previous sections.

This explanation
Use this parameter to add some comment about the action.


In our example, we are deciding to move the document using our previously defined Content Organizer Web Service. In this example, there are no specific conditions to validate for this action, but this is the area we can validate a document status and run the action accordingly.


Summary

We have shown how to use the Content Organizer Web Service and a workflow action. With this approach there are more configuration steps that need to be complete in order to support the solution.  The additional configuration does bring added value as it can enable us to route documents based on their content type to other document libraries.

For cases where a simpler approach is desirable, we can refer to the article below which essentially shows us how to use the Copy and Delete core actions to implement a simpler Move action.




I hope this is able to show you a way to move document across document locations using a workflow action and the Content Organizer Web Service.

Originally published by ozkary.com

0 comments :

Post a Comment