Extracting Info Path Attachment using Nintex

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.

Attachment1

I create a Nintex workflow on item creation on my library with following actions in sequence
Action 1 – Query XML

Attachment2_QueryXML

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

Attachment3_CreateItem

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

Attachment4_QueryList

Query the destination library to get the URL where the attachment has to be added.

Action 4 – Copy to SharePoint

Attachment5_CopyToSP

Copy your attachment (specified in XPath) in the URL (varTxtFileAttachmentUrl) saved in previous action i.e. Query List.

All actions put together

Attachment6_WF

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

Attachment7_Log

All these actions put together extract the attachment from the Info Path form. You can use them the way you want to.

Advertisements

20 thoughts on “Extracting Info Path Attachment using Nintex

  1. Hi I have tried the solution and I am a little stuck at the Copy Item stage it keeps looking for the file on my C;\ instead of my SharePoint Site. Could you tell me I am doing something wrong.

  2. Hi Manisha, I am new to SharePoint therefore I am having some difficulty trying to get this to work. May I know how and where do you get varTextFolderName and varTextFileAttachmentUrl from?

    • Hey Karen,

      Welcome to the SharePoint fraternity!!

      varTextFolderName and varTextFileAttachmentUrl are variables that I have created to store the intermediate values.

      You can see variables options in the ribbon on top, create these variables there and store the results of your nintex actions in these variables.

      Hope I am able to clear your doubt.

  3. Hi Manisha, thank you so much for your very prompt response.

    I created the variables, but AttachmentURL turned out blank. I wonder where I’ve gone wrong. Only varTxtFolderName and varTxtFileAttachmentURL contained information. And there was nothing stored in the newly created folder in AttachmentLib as well. Please refer to the screen shot: http://snag.gy/0Ec9Q.jpg

    Or would you be able to advise me how to email an attachment which was uploaded in Infopath form via Nintex workflow? I’d greatly appreciate it if you could point me in the right direction – I am so lost now.

    • Hey Karen,

      First check if you’re able to browse the url that you get in varTxtFileAttachmentURL. If that is fine, your “copy to SharePoint” action needs attention. Check the xpath and the overwrite options.

      For sending the attachment over email, once you’re able to seggregate your attachment, configure send notification action.
      In the attachment section, click on add attachment link -> existing SharePoint content -> click Insert Reference -> Select the workflow variable “Attachment URLs” -> Save and publish.

      It will work!

  4. Thanks for your help
    I have done all your steps and it works fine for one attachment. But I have different scenario I have repeating table for multi attachments.
    How can I attach all files in the repeating table?
    Thanks again

    • Hi Ahmed,

      Pretty unsure about your requirement, although you could try to see how you get the XPath in case of repeating table. If you can get that for all attachments, perhaps you will be able to copy. Personally, I haven’t tried it on my own.

  5. Manisha,

    I am not seeing the “copy embedded attachments” in the copy to sharepoint. I was just wondering if i am missing something.

    Thanks,
    Greg

    • Hello Greg,

      What kind of library have you created your workflow in?

      It is a form library for which if you create a workflow with this “Copy to SharePoint” action, you shall be able to see the options including “copy embedded attachments”.

      I think you’re using a document library… Do let me know on the result.

      • I created a forms library in Sharepoint, however i am still not seeing the “copy embedded attachment”. I am not sure what i am doing wrong at this point.

  6. Okay, i figured out what i was doing wrong, so i am now able to see the copy embedded attachments however it is not extracting them from the form. I am going to continue to work on it, but if you have an suggestions that would be great.

    thanks,
    Greg

  7. Hi Manisha, I’m currently having problems with this- I’ve copied the xpath exactly from the form, but it is still saying “failed to copy, could not find a part of the path…” – please help!!

    • Zoe,

      Compare the XPath from InfoPath form with the XPath generated from the XPath builder of ‘Query XML action’. You should have the same value. Also, ensure that the form has an attachment when you are running the workflow to extract it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s