Move doc from subfolder of one lib to another lin


Badge +4

Hi,  I and new to Nintex workflows and need help. Say i have Test lib and 2 folders france, Poland and status choice field (ready to Move, Rejected, Complete).  France has 2 folders (current rec and old rec) similarly Poland also will have same folders(Current rec and old rec) when the status of file from current rec is "ready to move " it should be pushed to Test2 lib and if the file in Test2 lib is rejected, the file should be back to France-Current Records folder. 

Please suggest how to move the file using source url so that file will be back to its appropriate location. 


12 replies

Badge +7

Hi, 

One of the option is to create a field in the destination list and setting its value to source folder URL.

Badge +4

HI, Can you elaborate/show how to do please 

Badge +3

Hi,

You can always use the "Call web service" action and call the "_vti/bin/copy.asmx" and copy the document to the desired location.

Create a List workflow and trigger based on the approval column status.

Steps:

1) Add the logic to derive the source url of the document and the would be destination url based on the approval status.

2) Add "Call web service" action to invoke "Copy.asmx" and pass the parameters.

3) Delete the document at the source by using "Delete item" action.Copy document

Badge +4

Hi Avinash, 

Thank you. i am able to copy to lib Test2. how to work on Rejection ? if the file in Test 2 is rejected it as to go back to its folder from the location it was in test 1 lib..

Thank you.

Badge +3

Hi,

Add a field SourceUrl to the library. Once the document is copied get the ID of the newly copied document and update the "SourceUrl" column with the link from where the document was initially copied. On rejection the document can then be moved to the original location by using action "Call webservice" as mentioned in my earlier response.

Hope this helps

Badge +4

HI Avinash, Thank you. I should add SourceUtl to Test 1 lib and ID from Test 2 Lib . If item with ID "x " is rejected in Test 2 copy to Test 1 right ?

Badge +4

HI Avinash, 

I got the newly copied document id from lib2 and filed FolderURL in lib2 with souceurl. I used query to query the lib2 with status=Rejected and used the "Call Webservice". I have error:

Failed to invoke web service. Error returned from server: <soap:Fault xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.

Can you please help? Also how to get the files from multiple lib's (lib1a, 2a, 3a, 4a) with status- Ready to Move and copy these files to lib2. Currently i have created one siteworkflow which query's 1 lib( lib1a),  moves the files to lib2.

Thank you for your help in advance!

Badge +4

HI Avinash, 

I got the newly copied document id from lib2 and filed FolderURL in lib2 with souceurl. I used query to query the lib2 with status=Rejected and used the "Call Webservice". I have error:

 

Failed to invoke web service. Error returned from server: <soap:Fault xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.

 

Can you please help? Also how to get the files from multiple lib's (lib1a, 2a, 3a, 4a) with status- Ready to Move and copy these files to lib2. Currently i have created one siteworkflow which query's 1 lib( lib1a),  moves the files to lib2.

 

 

Thank you for your help in advance!

Badge +3

Hi,

Can you try by assigning the actual url for SourceUrl and DestinationUrl?

Also check whether CheckOut-CheckIn enabled on the document lib. If CheckOut is enabled, this type of service error can occur.

Badge +4

Thank you Avinash, 

I assigned  the folder url from lib1 without filename for Sourceurl, thats why error. When i gave the actual url it worked. Thank You for your help.

Is there a way to get the files from multiple lib's (lib1a, 2a, 3a, 4a) with status- Ready to Move and copy these files to lib2. Currently i have created one site workflow which query's 1 lib( lib1a),  moves the files to lib2. or simply deploy the workflow on multiple lib's ?

Badge +3

Hi Rose, That's great it worked.

For handling documents from multiple libs I suggest

1) To create a master list where you store the names, url and List GUID of all the libs(lib1a, 2a, 3a, 4a). 

2) Query the number of entries in the above Lib List.

3) Add a For Each to execute until the above number is complete

4) Within the for each loop perform the actions done for copying the documents.

Badge +4

HI Avinash, 

I created Master list and stored lib names and URl filed(url of lib's)

I queried Master List 

In For each - Collected the ListURLCollection and stored in Variable ListStore. when i copy - from QueryMasterList what is that i should look for ? 

Reply