Nintex Workflow – Copy to SharePoint UDA

You’ll see in the video below, that I’ve found the Copy to SharePoint action very powerful, but the down side, is that it only runs on the current item the workflow is running on.  If it’s a document, it will copy the document to another document library.  If it’s an item the workflow is running on, the documents that are attached to the item will be copied to a destination document library.

This post is about running this process on an item, other than the current item.  Since there’s no action that will do it, I came up with a whacky workaround.

So attached below, is a User Defined Action. It take a few pieces of information, because you want to take a document or documents on some items and copy them to a doc lib.  Also, you want to specify whether you want to replace any existing item, rename or update.  But, in order for a workflow, running on Item1 in List1 to copy the document attachments from ItemX running on the Workflow Tasks list, we need a workflow to run on ItemX.  So this UDA, actually has an embedded Nintex Workflow in it, which it will publish to the destination list/library, run it on that item, wait for it to finish and it will delete that workflow.

In essence, we are creating a temporary workflow.  Not really something you expected, is it? 🙂

This is the example where I think it will fall into place.

List : Expense Request

Workflow runs on this list when someone submits their expenses.  The workflow assigns a task to the initiators Manager, and the task will be in Workflow Tasks list.

Part of the task, is that the Manager needs to click on approve, but also attach a signed document to the task.

The workflow needs to grab that attachment and copy it somewhere.  In this case, once the task is completed, you can run this UDA and tell it to copy all the attachments from that task, to a document library called Signed Expenses.  With this UDA, this can all be done, from one workflow (kind of).  Although a workflow will run on that task, it’s temporarily published, run and deleted.

Conclusion

The thing you will need to do, after you import the UDA, is tweak the Call Web Service actions.  They are using a Nintex Workflow constant called WorkflowStartCred.  There are three Call Web Service actions, so make sure you expand the Action Sets to find the ones in there also.

Also, I don’t usually do this, but this UDA is completely one column of actions and no branching.  It’s odd as I don’t ever design workflows like this.  But, I do want to add, that I have put very little error handling (none actually), into this UDA, so you may want to add that, if you want this to be production worth.

Downloads

Nintex Workflow 2013

Download the User Defined Action – Download it an import into the New User Defined Action page

Leave a Reply

Your email address will not be published. Required fields are marked *