Skip to main content

Ok i have 2 libraries that use the same content types. I have a workflow that copies a document from one library to the other. Both libraries use versioning, but the target does not require checkout to edit. After the document copy I want to set the version  number from the original document on a custom text field on the copied library. I use update item to set the text field of the target document to the version number of the source document. For some reason this update item fails every time. I have also tried setting the column with hard coded values but I continue to get errors in update item. Unfortunately that is all I get An error has occurred in Copy to Published. 

This seems like it should be really simple, but I cannot figure out what I am missing here. Any ideas? 

Thanks,

  Berney

Hi Bernard Gehring‌,

Please share the workflow so I can check the details. My first reaction is adding a 'Commit pending changes' somewhere but having the details will help in helping you.

Cheers,

Rick


Hi,

does the initiator of the workflow have permission in order to update the document in destination library?


203070_pastedImage_1.pngSo I set this up so that the regular expression checks the version if the document, if it is published then the rest of the workflow runs. It copies the item to the new library, the document is successfully copied so this shouldn't be a permissions issue, then after commit pending changes it runs the update item. Disabled in the above view so that users don't get the error. 

Thanks for any help.

Berney


So how do you know which item to update in the target library? Can you show me the details of the 'Update item'.


203071_pastedImage_1.png

Copied file is the result of the copy to SharePoint action.


Are you sure this url variable works? Please read the following blog post:  

Cheers,

Rick


I am fairly sure. I cleaned up some of the logging I had in place when I posted the workflow earlier. I log in history the result returned from the copy item action and the version string. Then I am performing a query of the new list based on URL Path. I get a result from performing the query and then attempt the update the item using the same filter criteria, based on url path. I will try using that query I did to get the ID, then try the update based on the ID see if that works.


Using the file ID that I got out of the query statement querying on URL Path seems to have done the trick. Thank you all for your help on this.

Berney


Hi,

because it looks like you've solved your issue, could you mark one of the answer to this post as correct (even one of yours), so this will help the community?

Thanks

Giacomo


Reply