Every so often while working in SharePoint, you encounter a feature that has almost no documentation or you can’t find anyone with a similar issue. This happened to me when I was trying to configure a workflow to move a document set to a Records Center. After I got this to work, I wanted to try and save others the grief and frustration that I experienced. If “Unknownerror” means anything to you, this post is for you.
This action might be useful in document management scenarios, where documents have a formal “approval” process, and management policies are defined to “expire” them to meet retention policies. Once expired, they would be removed from the current location and moved to another location, specifically a Records Center in this case where they sit waiting to be purged from the system.
Let’s cover some background. For this to work, there is some pre-work and configuration that has to be done. You have to have configured content organizers on the source and destination sites and routing rules. I won’t cover that here. This post is just to explain a particular component in this overall process.
The workflow action we are talking about is Send Document Set to Repository. It is NOT available with SharePoint Foundation, you have to have at least SharePoint 2010 Standard or higher. The only official documentation for usage from Microsoft is here. Here is their explanation:
This action is initially displayed in workflow steps as Submit Document set using this action to this destination content organizer with this explanation (Output to Variable: submit file result). It allows you to move or copy the document set to a document repository. A document repository can be a library in your SharePoint site, or a site on its own like the Document Center, that routes records to a specific destination based on rules that you define.
Following is an example of what the action might look like in a workflow step:
Submit Document set using Copy to DocumentRepository:GUID with Copy final bill of Material to repository (Output to Variable: Copy Document Set to repository)
To add When you add this action to your workflow, it looks like this:
Let’s break this down:
The big question is what do do you enter for the destination content organizer? From the Microsoft article above, it’s “documentrepository:GUID”. Is this the GUID of the Records Center site? The Drop Off Library? A few bloggers have said it should be the link to the web service. Which is it?
The answer is they’re both right. The Microsoft article is correct, but it also doesn’t tell the whole story. To correctly work, you should enter the URL of the content organizer web service on the Records Center site. It should be entered in the format:
If you enable verbose diagnostic logging for Workflows, you will see that SharePoint converts the first portion of the URL <http://portal/recordcenter> to <documentrepository:2fdee837-9501-4305-b15a-0bf5fb9a8832>, with the GUID is the ID property of the Record Center site collection. The Microsoft article should really be updated to reflect this.
When this doesn’t work correctly, the error is vague to say the least. All you will see is Unknownerror. Great, thanks, that’s really helpful. To get any kind of decent error message, you need to up the ULS logging to verbose for the Workflow categories. You can find directions here on TechNet. Once that is set, run the workflow again and you should get more specific errors. There can be errors like:
at Microsoft.Office.RecordsManagement.RecordsRepository.OfficialFileCore.SaveFileToFinalLocation(SPWeb web, EcmDocumentRouter router, EcmDocumentRouterResultProperties resultProps, Stream rgbFile, Hashtable fileMetaData, String strSourceUrl, String strUserName, Boolean bCopy, Boolean bIsDocSet, Boolean bIsDropOffZone, SPListItem& itemFinal)
All of these errors are caused by the fact that the content organizer isn’t setup correctly. The best way to test this is manually by creating SendTo rules in Central Administration to the Records Center and try to move the document set. If it works, you should be good. If not, check the configuration. In my case, the document set content type wasn’t added to the drop off library. Once I corrected this and had proper routing rules setup, it moved fine, and I got Success in the workflow output.
Hi Anbuj, There could be a couple of things wrong. The drop off library is the temporary holding location for documents during routing, and before they move out of this library, they have to match a routing rule. I would check the routing rules you have in site settings and make sure you have a routing rule that matches your document. If that checks out, watch the ULS logs while you run your workflow. It will have entries for the routing, and give an error if it fails. It would say something like "document failed to match any routing rules" or something like that. To make sure the wiring is correct, just do a manual send to first. From the document click the list item drop down, send to -> your destination. This just takes the workflow out of the equation and makes sure your routing is setup correctly. Doug
So once the document is submitted sing "Copy", is there any way for the workflow to access the newly created record?
@Avinash, Yes, that is possible in document sets. A document set can have columns just like a list or library. @Frank, I suppose it's possible, but it would likely be easier to have another workflow on the destination so then you could just use Current Item. Otherwise, you would have to be able to lookup the document in the target, you won't know the ID in the target so you would need to use Title or some other unique value that would identify that file. That's why I say it's easier just to separate the workflows.
Very good article. It helped me to solve the misterious "Unknown Error" on my workflow. Anyway, I wanted to move the file to a custom created Library, but instead my files are moved to Drop Off Library. I'm new to sharepoint. What am I missing here?
good post,thanks for your sharing
Hi,I want to move and delete the document set's in the document library based on the value on a column in the document set, eg: If the value on the column in the document set is set to completed then this document set and all its contents should be copied to another library and the document set deleted in the original library, Is this possible on document sets ?? A
The complementary paper includes over 12 years of research, recent survey results, and CRM turnaround success stories.
This 60-second assessment is designed to evaluate your organization's collaboration readiness.
Learn how you rank compared to organizations typically in years 1 to 5 of implementation - and which areas to focus on to improve.
This is a sandbox solution which can be activated per site collection to allow you to easily collect feedback from users into a custom Feedback list.
Whether you are upgrading to SharePoint Online, 2010, 2013 or the latest 2016, this checklist contains everything you need to know for a successful transition.