Submit InfoPath form to SharePoint List or Library using Content Type - SharePoint Development & Administration
Stumble This Delicious
Delicious
submit to reddit
Facebook
MySpace
MySpace

Sunday, June 28, 2009

Submit InfoPath form to SharePoint List or Library using Content Type

The following article demonstrates how to integrate an InfoPath form with a SharePoint form library, using a centralised template stored in a SharePoint document library and linked to a site Content Type. The form is set up to submit to a SharePoint form library

Overview:
  1. Set up SharePoint libraries
  2. Design the form template
  3. Publish form template to SharePoint Content Type
  4. Configure the form's primary data connection to submit to the SharePoint library
  5. Secondary Data Connections to receive or submit data to a SharePoint list
Setting up SharePoint to store the Form template and receive Submitted forms:
If InfoPath Form services are available on your SharePoint server, you have the option to store the form template using Central Administration's managed templates list.










To make the form available using this method it must uploaded to the Managed Templates List, the activated for the required site collection.

In this example I publish the form template to a Content Type, saving the template to the "Form Templates" document library in SharePoint. The content type can then be added to a Forms library or Document Library in SharePoint. When the "New" button is clicked on the SharePoint Document Library, a blank InfoPath form will open (in InfoPath, or the browser depending on form, SharePoint and client settings).
  • Create a Document Library to store the form templates. This can be a standard document library. Users of the form template only require read access to the form template to be able to fill out and submit a form. Restricting users acccess to "Read-Only" on the document library containing the form template will prevent any unauthorised access or modifications to the form template.
  • Note: Standard Version control and approval workflows can be set up to help manage form templates in this library.
  • Create a Form Library to store submitted forms and meta data. Use the standard Forms Library.
Design the Form
  • Open InfoPath and Design a Blank Form Template











  • From the Controls toolbar, add 2 text boxes to the form.
  • Right click on the first text box after and select "Text box properties" -> set the field name to "Description_1".
  • Repeat for the second text box, set the field name to "Description_2"

Set up the Primary Data Connection to submit to SharePoint

  • From the Tools menu, select "Submit Options..."
  • Check "Allow users to submit this form"
  • Select "SharePoint Document Library" from the drop-down list
  • Press "Add..." to set up the Primary Data connection
  • Enter the url of the form library created in the second step.
  • Press "Next"
  • Press "Finish"
  • Press "Ok" to close the Submit Option dialog.

Publish the form template to a SharePoint Content Type
  • From the file menu, select "Publish...", you will be prompted to save the form template locally if you have not done so. You are required to do this to be able to publish the form template to SharePoint.
  • Select "To a SharePoint server With or Without InfoPath Form Services" when asked where to publish the form template.




  • Enter the URL of your SharePoint Server, Example "http://SharePointServer/"



  • Select the publish method: "Site Content Type"
Publish Methods for InfoPath form Templates:
-Document Library: The template will be stored and set as the new item template for the specified document library.

- Site Content Type: You will be prompted for the location to store the form template as well as details of the Content type the template is being published to. Publishing a to a content type allows the template to be used in multiple document libraries.

- Administrator Approved Form Template: Allow the template to be published and made available using the Central Administration Managed Templates List.

In this example I will be publishing the form template to a site content type.



  • Select "Create a new Content Type"





  • Enter a name for the content type




  • When asked to specify a location for the form template, enter the URL of the library created in the first step, press Next.
  • Press "Add..", and select the "Description_1" field from the list
  • Repeat for the second field
  • Press "Next"
  • Press "Ok" to close

Add and Set the Content Type as the Form Library's Default
  • Using the browser, navigate to the SharePoint Form library created in the second step.
  • From the "Settings" dropdown menu for the library, select "Forms Library Settings"
  • Under the General Setting heading, click "Advanced Settings"
  • Select "Yes" to Allow management of content types
  • Press OK
  • Under the Content Types section of the Library Settings page, select "Add from existing site content types"
  • Add the newly created content type from the form library, press OK
  • You can either remove the default "Document" content type from the library or set the new content type as the default to allow a blank form to be opened in a browser or InfoPath when the "New" button is pressed on the form library.

When a new form is submitted, it will be submitted to the specified SharePoint form library, with data from the fields in the InfoPath form being mapped to Columns in the library.
Share this article:
Stumble This Delicious
Delicious
submit to reddit
Facebook
MySpace
MySpace

0 comments:

Post a Comment