cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to move an attachment from infopath form at time of submission using Nintex 2007

Jump to solution

Hi - hoping someone can help.  I have Nintex 2007, using with an Infopath form.  I'm trying to convert my infopath form to a web form so it can be used on a mac.  In doing so, I have now run into a size issue.  The form allows users to add 1 to many attachments, and because of my portal limitations, I am limited to 5MB.  So I am trying to create a workflow using Nintex to take the attachment from the infopath form and move it to a shared document library at the time of submission - not just copy it.  The infopath form itself will not save with an attachment > 5MB.  I can't allow the users to simply enter a URL either, too many errors in getting the correct URL....   Thanks so much for any help!

Labels: (2)
Tags (1)
Reply
4 Replies
Workflow Hero

Re: How to move an attachment from infopath form at time of submission using Nintex 2007

Jump to solution

To address the size limit, this is a hard limit to a farm for a form library. You can make adjustments to the system config files to allow more, but it's generally not advised. If you move to a custom list and use InfoPath as the custom form, the 5 MB limit does not apply there as it will store as an attachment to the list item.

If you use a list item attachments, you can move documents using the author.dll MoveDocument web service method to move to somewhere else.

0 Kudos
Reply
Workflow Hero

Re: How to move an attachment from infopath form at time of submission using Nintex 2007

Jump to solution

I've done this with InfoPath 2010, but it should work the same.

 

Create Branches for Multiple Attachments

  • Add ‘Run parallel actions’ action
  • Insert as many Branches as necessary (ex. if you have 5 attachments on your form you will want 5 branches)
    • Click Branch drop-down
    • Select ‘Insert Branch to the Left’ or ‘Insert Branch to the Right’ as preferred

Note: For the instructions below I will be referring to Attachment 1.You will build these workflow actions along one branch, then copy and paste that workflow for the other branches, and edit the actions to point to the appropriate fields/Variables/xPaths for each new attachment (Attachment 2 and Attachment 3 in example workflow).

  1. Add  Run if’ action (to kick off workflow when attachment is added – everything else will be built within the Run if)
    1. Condition = ‘If current item field equals value’
    2. Where = ‘File 1 Attached’ ‘equals’ ‘value’ ‘Attached’
    3. Click ‘Save’
  2. Create Variables
    1. Click Workflow Settings drop-down and select Variables
    2. Click New
      • Name = txtAttach1URL
      • Type = Multiple lines of text
      • Click Save
    3. Click New
      • Name = txtAttach1URLConverted
      • Type = Multiple lines of text
      • Click Save
  3. Add ‘Copy to SharePoint’ action (to copy attachment to another library)
    1. Destination
      • Select ‘Enter a URL’
      • Copy and paste url to attachment library
      • Select ‘Copy embedded attachments’
      • Copy and paste XPath (on InfoPath form, click on Attachment Field, click drop-down, click Copy XPath, and paste in Nintex action XPath field)
    2. Overwrite options = Rename new item
    3. Copy item meta data = check to copy metadata populated in Form library to attachment library (you may name the fields without spaces, but if they translate to names with spaces in the library that is exactly what you need to use when you name the field in the attachment library)
    4. Store result in = ‘txtAttach1ULR’
    5. Click ‘Save’
  4. Add ‘Regular expression’ action (to remove spaces from attachment URL)
    1. Pattern = ‘\s’
    2. Operation = ‘Replace text’
    3. Replacement text = ‘%20’
    4. Input text = Click Insert Reference, Select Workflow Variables, Select ‘txtAttach1URL’
    5. Store result in = ‘txtAttach1URLConverted’
    6. Click ‘Save’
  5. Add ‘Pause for…’ action (to ensure the previous steps complete before moving forward)
    1. Minutes = ‘1’
    2. Click ‘Save’
  6. Add ‘Update XML’ action (to update Attachment URL & update Attached field from Submitted to Copied)
    1. XML Source = ‘Current item’
    2. Update 1
      • XPath query = Paste URL (File1URL) field’s XPath (see step 3. a. iv. For instructions)
      • Selected node(s) action = ‘Replace node contents’
      • Click Insert Reference, Select Workflow Variables, Select ‘txtAttach1URLConverted’, and click OK
    3. Click Add XML Updates
    4. Update 2
      • XPath query = Paste File 1 Attached (File1Attached) field’s XPath (see step 3. a. iv. For instructions)
      • Selected node(s) action = type ‘Copied’
    5. Store result in = ‘Current item’
    6. Click ‘Save’
  7. Add ‘Pause for…’ action (to ensure the previous steps complete before moving forward)
    1. Minutes = ‘1’
    2. Click ‘Save’
  8. Add
    ‘Update XML’ action (to delete attachment)
    1. XML Source = ‘Current item’
    2. Update 1
      • XPath query = Attachment (File1Attachment) field’s XPath (see step 3. a. iv. For instructions)
      • Selected node(s) action = ‘Replace node contents’
      • Leave field below blank
    3. Store result in = ‘Current item’
    4. Click ‘Save’
  9. Copy the actions for Branch 1s Run if, paste for additional branches (for my example I did this for 2 additional Branches) and updated fields/Variables/and XPaths
    1. Click drop-down for ‘Run if’ action and select ‘Copy’
    2. Click node beneath next Branch and select ‘Paste’
    3. Double click on each action and change File 1 attachment fields to File 2 and then file 3
0 Kudos
Reply
Not applicable

Re: How to move an attachment from infopath form at time of submission using Nintex 2007

Jump to solution

Theresa - your post helped a lot!  Have a couple questions, if you can help me further:

  1. Does it violate the infopath form, when a workflow operation (Update XML) tries to
    update a field in the form?

               If not, do both from Check-out and check-in have anything to do with this action?
               Because I got an error : ‘Error processing XML. The file                     "http://h2.aafes.com/sites/14/ebusiness/IDM/MSTGrp/MST_NIIF/Item
Workflow TESTING/Case 60122 Hardlines...
" is not checked out. You must first check out this document before making changes’

    

     2.  Does the version of Nintex matter? (I could not find some actions / parameters you mention)

Thanks!
Erin

0 Kudos
Reply
Highlighted
Workflow Hero

Re: How to move an attachment from infopath form at time of submission using Nintex 2007

Jump to solution


Erin, in answer to question # 2, I'm using SharePoint, InfoPath, and Nintex 2010. I do know of a co-worker who did this with SharePoint and Nintex 2010 and InfoPath 2013.

As to question #1, we do not have forced check out set up on the InfoPath form library and we do not check out or check in the file. One thing we noticed is that you shouldn't open the form until you are sure the workflow has completed. If you open the form before Nintex completes all of the actions you will get an error message - typically because it hasn't had the chance yet to update the InfoPath form. Another thing I've noticed is that different files can have renaming issues. Your file name looks okay, but I have not tried this on .xml files. Examples of errors I've seen are when a PDF is attached with ".PDF" instead of ".pdf" as the extension, when symbols are used in .html files, and when there is a space in the file name before the extension (ex. file name .pdf).

I hope this helps.

Theresa

0 Kudos
Reply