4

I am trying to copy multiple documents from one library to another using SPD workflow2013 in which am using REST API's and Looping, for copying single document I followed This article and it works fine for a copying single document to another library because there am passing the hard coded name of that specific item/file which is available in my document library.but here I want to copy multiple documents and for that I used the Loop in SPD workflow along with REST API's,here with help of Loop am reading all names of documents from my document library and simply passing this to REST API instead of hard coded name but this is not working as I want ,inside loop when am reading all documents by calling REST API call action it gets only first item/file name and when am reading all documents by not calling REST API call action and simply log that item name variable to WF history then it is going through all items and showing these names in log history .
my workflow without Calling Rest API call action is as like below snap
enter image description here
Output
enter image description here
my workflow with Calling REST API call action is as like below snap
enter image description here
and it's output is as like below snap
enter image description here

  • I suspect there is a problem with your REST URL. Build the REST URL in a string variable and output it to the log and then use the variable for the address. It would also be good to output the responseCode8 variable as well to verify you got the desired response. – theChrisKent Dec 2 '16 at 14:24
  • In your copy action you have /sites/appdev/Preparation/[%Current Item:Title%]/[%Variable: Name%] Should "Current Item Title", really be "Workflow Context: List Title"? I think it really needs to be the url of the List you want. The List Title may not be the List URL. – Omar Stewey Dec 2 '16 at 16:12
  • @OmarStewey actually am copying item to another list in which am creating the folder of that list item name so thats why am puthing this([%Current Item:Title%]/[%Variable: Name%]) in my URL – Madhav Dec 5 '16 at 4:17
  • @theChrisKent i tried what you suggested but still the problem is as it was,you can see that here(i.stack.imgur.com/6ovbn.png) – Madhav Dec 5 '16 at 5:49
  • Does it work if you copy to the root of the library? Without the item title? – Omar Stewey Dec 5 '16 at 7:05
2

Finaly Resolved the Issue,there was one small problem and that was the response after first Iteration was not proper means that was not get changed as per Iteration,Resolved the Issue by simply calling the call action same as above inside loop in which I'am iteration Item Names from Library
it's same as below snap
enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.