This is related to Copying items between lists while preserving attachments.
We have a complicated form approval process that goes through many people to get all the information needed. We are using Nintex forms to split up data entry, but along the way there could be many attachments. We need to grab the attachments from the task list and get them attached to the original list item so we can make these viewable to approvers later in the workflow.
Trying to come up with the copy webservice to copy files from one attachment folder in explorer to another. One of the copy methods requires the base 64 for the document and we do not have the means to get that. I am aware of Vadim's Happy Thanksgiving solution, but the powers that be are not allowing us to install that through our central admin without the base code.
The other methods error out stating that we are not pointing at an instance of an object.
If anyone has any ideas on how to copy the files from the task attachment folder to the list item attachment folder through a workflow, I would appreciate any input.
Solved! Go to Solution.
I have implemented a resolution using Vadim's solution - which works a treat. Prior to this, the way we approached it was to have all the attachments get hived off to a dedicated document library, regardless of where they get attached along the way.
This was done for the original Item List, by building into the workflow, a "Copy to Sharepoint" Action set. The initial "Copy to SharePoint" control will move any attachments on the item to the destination Library. Other parts of this Action Set update the destination document library items to stamp them with the related original Item ID and any other information you wish. We also prefixed the Document Name with the ID.
With regard to the Task Attachments, a similar Action set was incorporated into a separate workflow that runs on the WorkFlow Tasks List. This workflow is called after the Task has been actioned and is only triggered if there any attachments on the task. You then utilise a "Call Web Service" control using the "_vti_bin/NintexWorkflow/Workflow.asmx" service and the "StartWorkflowOnListItem" method to start the WorkFlow Tasks workflow. You need to feed in the parameters for the Workflow Task List name, Workflow to call and the Task ID to run the called workflow on.
In essence, once the task workflow is called it will do the same thing as the Item workflow. That is, copy all the attachments from the Task Item to the document library and subsequently update the relevant fields on the Document entry to ensure it relates back to the original item.
Within all the forms, you can present a List View section for attachments that is filtered on the original item ID number, but points to the Document Library. This should ensure that only the relevant documents appear.
It needs to be noted that you still need to have the original Attachment Control on the form to allow users to add any new attachments, but probably hide it on the display version of the form.
This is only an outline of what I did to give you an idea. There is a lot of other controls built in to ensure that everything performs as it should.
This is effectively a workaround, as the original attachments on any of the forms, don't actually move, they are just copied to a central location.
Thanks for the info Mark, we may look into something like is if our other solution doesn't work for the long term.
We used another of Vadim's posts (http://vadimtabakman.com/nintex-workflow-get-attachment-urls-uda.aspx) to get the attachment URLs and post them into email notifications and columns as links to the task attachments. It isn't the prettiest and figuring out all the formatting was a beast, but I think it will work for now.
Hi Mark, this looks like the solution I have been looking for to access attachments from list items. Can you clarify how the "Other parts of this Action Set update the destination document library items to stamp them with the related original Item ID and any other information you wish" could be configured?
I'm not sure what version or platform you are using, but certainly the mobile version of the Nintex form also displays the list view control (not webpart) on my SharePoint 2013 On premise system. If you are actually deploying this via Nintex Mobile there may be issues as the List view depends on realtime access to the SharePoint list.