Of late I had been working with Info Path forms, always using the attachment control to upload files. However, anytime I had to see the attached file or use it to send in an email, I had to open my Info Path form. Obviously not a very great approach as my users didn’t wanted to do this all the times.
This led me to do a bit of research and here I am able to extract the attachment using a Nintex workflow. Below is the simple sequence of steps to achieve the same.
I create a simple Info Path form with just two controls – title and attachment, and publish it to my form library.
I create a Nintex workflow on item creation on my library with following actions in sequence
Action 1 – Query XML
Query the current item using XPath to get the title and save this in a workflow variable. I do this since my requirement is to create a folder of the title’s name in another library where the attachment from Info Path form will be saved.
Action 2 -Create Item
Create an item of folder type in the destination library (here AttachmentLib) with the name as desired. Mine is the title as mentioned earlier.
Action 3 – Query List
Query the destination library to get the URL where the attachment has to be added.
Action 4 – Copy to SharePoint
Copy your attachment (specified in XPath) in the URL (varTxtFileAttachmentUrl) saved in previous action i.e. Query List.
All actions put together
The logging in the last action actually gives a clear picture of all the actions above. On logging all the variables, what we get is
All these actions put together extract the attachment from the Info Path form. You can use them the way you want to.