at01
Canvas Initiate

Copy to SharePoint action failing SharePoint 2010

Hi,

So the scenario is that I have a document library A that contains folders and files. When a status is updated to "sold" a nintex workflow will run and if this condition is met, create a new folder with the same name and metadata in document library B, copy all the contents of the source folder from doc library A into the newly created folder in doc library B, then delete the original folder and files from doc library A.

Both doc libraries exist within the same site collection and site for that matter. There are several variations of this type of workflow already working within my environment.

However, I've had to recreate one today and each time I run it the workflow errors at the Copy to SharePoint action with the following:

Failed to copy item. Object reference not set to an instance of an object.

To explain my workflow some more, I have a conditional action to begin that checks if the folder's status is "sold", from this I set a "FolderName" variable to the name field of the folder. After some logging and checks I then create an item in doc library B (essentially the folder, which works fine), then I use the Copy to SharePoint action to copy the folder contents into the new folder in doc library B. I build the URL as a string, using the URL of the destination library, plus the FolderName variable I captured earlier.

 

What's weird is I can see that the variable is capturing the folder name and the folder is being created. But I cant understand why the copy action action falls down each time.I've atttached the config behind my copy action for info.

 

Any advice greatly appeciated!

0 Kudos
Reply
3 Replies
eharris04
Workflow Hero

Re: Copy to SharePoint action failing SharePoint 2010

This is an odd thing for sure. I would suggest looking at this post here and see if some of the steps in this or comments apply to your situation.

 

https://community.nintex.com/t5/Nintex-for-SharePoint/Receiving-Object-reference-not-set-to-an-insta...

0 Kudos
Reply
at01
Canvas Initiate

Re: Copy to SharePoint action failing SharePoint 2010

Hi @eharris04,

Thanks for the suggestion, I turned on error handling and now its completing all the actions in my workflow. Curiously, its not actually copying any files across though. the workflow completes and all actions are green but theres nothing in the newly provisioned folder in the destination doc library.

0 Kudos
Reply
at01
Canvas Initiate

Re: Copy to SharePoint action failing SharePoint 2010

Just a quick update on this one, I have realised I was running the workflow at the incorrect level!

When I run the workflow at the file level the file copies across as expected. I think to be able to run this workflow at the folder level to copy all its child items I would need to do something similar to this post:

http://www.vadimtabakman.com/nintex-workflow-copying-a-document-library-folder-and-contents.aspx

Definately one note to take home was enabling error handling allowed my workflow to complete so a useful exercise!

0 Kudos
Reply