There are a couple of ways to integrate Content Types with InfoPath forms libraries. I’m going to cover one scenario, but I’m sure there are more.
My scenario is that I want to submit a form to a SharePoint 2010 Forms library and align the data collected on the form to existing columns in my Content Type. Here’s a summary of the steps:
· Create a Site Content Type in SharePoint 2010 (my example is HR Forms)
· Create a Forms Library in SharePoint 2010 (my example is HR Forms Test)
· Add the Site Content Type to the newly created Forms Library
· Create a new form using InfoPath Designer 2010
· Publish the form to the form library, mapping the fields on the form to the existing columns in the library
Ok, now for some detailed steps:
Create a Site Content Type in SharePoint 2010
Go to the site in SharePoint 2010 where you want to define your Content Type (this will vary based on your requirements). For my example, I’m creating my Content Type in the root of my site collection, which is at http://intranet .
Go to Site Actions menu –> Site Settings –> Site Content Types.
At the top of the list of content types, click the Create link. You should see a page like this:
I’ve already filled in my Name “HR Forms”, selected the parent content type, and selected an existing group. Click Ok to create your Content Type.
You’ll then be returned to the list of content types – look for your newly created content type under the group that you either chose or created.
Once you locate your content type, click on it. This will bring up the Site Content Type Information page, which contains the settings for your content type. You’ll need to add columns to your content type, which is near the bottom of the window.
Once you’ve added some columns, your page should appear something like this:
Now that the content type is ready, we can move onto our next step.
Create a Forms library in SharePoint 2010
To create a Forms library, go to the Site Actions menu, and select “More Options”. A Create window will appear displaying all of the options of things you can create in SharePoint. If you click on the Library filter on the left, the window will only display libraries (as you’d expect). For our scenario, we need a Form library, so click on Form Library and fill in a name for the new library on the right. Your page should look something like this:
Then click Create. You should now see your forms library:
Add the Site Content Type to the newly created Forms Library
Our next step is to finish configuring the forms library (that we created in the previous step). To do so, go to the forms library and click on the “Library” tab in the ribbon at the top of the page. Then click “Library Settings” which will be near the right:
On the Form Library Settings page, you should see General Settings and then a Columns section. However, you won’t see Content Types. First, you’ll need to allow content types to be used with this forms library. To do this, click on the Advanced Settings in the General Settings section.
On the Advanced Settings page, you’ll need to set “Allow management of content types?” from “No” to “Yes”. This is the first setting at the top of the page. There are a lot of options on this page, but you’ll only need to change the first one for our scenario, so change it and click Ok to save your change.
Now, when you return to the Form Library Settings page, you’ll see Content Types immediately below the General Settings section.
Now, click on “Add from existing site content types” in that Content Types section. On the Add Content Types page, find the content type you created and Add it by selecting it and moving it to the “Content types to add” box, and then clicking Ok.
When you return to the Form Library Settings page, you should see your Content Type listed in the Content Types section.
Create a new form using InfoPath Designer 2010
The next step is to create the form in InfoPath. To do this, you’ll need to open InfoPath Designer 2010. When you open InfoPath, it should display the New window (if not, go to the File menu/backstage and select new):
In the new window, select “SharePoint Form Library” and click the “Design Form” button on the right. InfoPath will then create a new form for you to edit. Make any changes that are necessary, including adding fields that your form needs to collect from the user. Be sure to create fields for any Column that you’ll need to populate in your Content Type.
Once you’ve got your form the way you want, be sure to save it.
Publish the form
The next step is to publish the form so users can access it in SharePoint 2010. To do this, go to the File menu (backstage) and select the “Publish” choice on the left:
Now, click on the “SharePoint Server” option. (If you haven’t saved your form, you will be prompted to save it at this point.)
The Publishing Wizard will open. You’ll need to enter the URL of the SharePoint site:
On the next screen, you need to select “Form Library” from the choices:
On the next screen, you want to select “Update the form template in an existing form library” and then select the library that you created earlier:
On the next screen, you will need to align fields in your InfoPath form to the columns in your Form Library. Click Add and then select the field in the top of window and the matching Form Library column in the lower half:
Repeat this step for each field that you want to map to the Form Library columns.
When you’re done, click Next and then Publish. InfoPath will publish the form and then give a summary of the just published form.