Usually I use REST requests to copy files (Call HTTP Web Service action).
For example, to copy attachements from item to another :
{Variable:Current Site URL}/_api/web/getfilebyserverrelativeurl(@v0)/copyto(strnewurl=@v1,boverwrite=true)?@v0='{Variable:Attachment URL}'&@v1='{Variable:List Relative URL}/Attachments/{Variable:List Item ID}/{Variable:Attachment File Name}'
After having featch the Request Digest to be able to do POST request, by calling :
{Variable:Current Site URL}/_api/contextinfo
and fetching the XML node : //* local-name()='FormDigestValue']
Hi @allan,
thanks for your feedback. I already use "call http web service" action to copy list item attachments to a library, but I am not able to configure the action properly the other way around.
So could you please explain a little more detailled, how to use and configure the actions to add a document to a list item attachment?
Many thanks in advance.
In fact if you already managed to copy a list attachment to a doc lib, it is the same thing.
You just have to copy the file to /sites/YourSite/Lists/YourList/Attachments/YourItemID/YourFile
Hi allan,
thanks for your reply. I tried that earlier, but was unable to use this structure /sites/YourSite/Lists/YourList/Attachments/YourItemID/YourFile in O365. I was not able to copy a file to a list item, in the way I tried it. But maybe there was a fault in my request.
Anyway, I could resolve my issue by using Nintex Workflow Cloud - that was very easy and simple.
But as soon as I have a bit more time, I will give a new try to your solution 🙂