Skip to main content
Email Password   helpLost your password?

Introduction

InfoPath can be configured to allow users to submit an InfoPath form to a SharePoint library automatically with a unique name and without creating a different file name each time a form is resubmitted.

Summary

The following solution assumes that a SharePoint (MOSS) 2007 or SharePoint Services 3.0 library and an InfoPath 2007 template have been created.

A hidden field is added to the form template. Each form is assigned a unique filename by concatenating field(s) in the form with the now() function. Rules are added to the Submit options to determine whether or not a filename exists, so each time a form is resubmitted, it is not saved under a different filename.

Note: An InfoPath form can be added to SharePoint by assigning a unique filename directly in the Data Connection without using a hidden field or rules, but the use of the now() function will cause the form to be saved under a different filename each time it is resubmitted.

Steps

Step 1 – Create a Hidden Field

A hidden field is a field that exists in the data source of the form but is not visible to the user.

The easiest way to create a hidden field is to drag-and-drop a text box control onto the form template’s view. Rename the text box to ‘filename’ and click OK. Then select the filename text box and hit delete to remove the field from the view.

image001.jpg

Step 2 – Add a Submit Data Connection

Go to Tools, Data Connections and click Add. Create a new Connection to Submit data to a SharePoint document library:

image003.jpg

image004.jpg

Enter the document library, and click the fx button and Insert the field ‘fileName’ in order to give the form submitted the name stored under ‘fileName’. Select ‘Allow overwrite if file exists’.

image005.jpg

Give the data connection a name:

image006.jpg

Step 3 – Add Custom Rules to Submit Action

Go to Tools, Submit Options, and click on Rules.

image008.jpg

Add two rules as follows:

You should now have the following 2 rules setup for Submitting Forms:

image017.jpg

History

You must Sign In to use this message board.
 
 
Per page   
  
-- There are no messages in this forum --


Last Updated 8 Jun 2009 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009