2 Ways to create SharePoint list forms in InfoPath 2010
Learn how you can use InfoPath 2010 or SharePoint 2010 to create an InfoPath form that allows you to view, add, edit, and delete items in a SharePoint list without having to write code.
InfoPath 2010 introduced a new type of form template you can create, a SharePoint List form template.
A SharePoint List form template allows you to create an InfoPath form that is bound to a SharePoint list, and which you can use to view and edit items in a SharePoint list.
There are two ways you can create a SharePoint List form template:
- From within InfoPath Designer 2010, when you go to create a new form template, use the SharePoint List form template to base your form template on and then link the template to a new or an existing list in SharePoint.
- From within SharePoint 2010, click the Customize Form button on the List tab on the ribbon when you've navigated to a SharePoint list.
Other than these two methods, there isn't another way to link an InfoPath form template to a SharePoint list unless you write code to submit InfoPath form data to a SharePoint list.
If you look on the Data tab under the Submit Form group in InfoPath, you won't find an option To SharePoint List. This is because a SharePoint List form template is a special type of form template that is very similar to the Database form template which you can link up to a database.
For a SharePoint List form template, InfoPath takes care of creating queryFields and dataFields in the Main data source of the InfoPath form for you to be able to query and submit data to the SharePoint list. And therefore, the Main data source is locked from modifications when you create a SharePoint List form template.
Figure 1. Main data source of a SharePoint List form template in InfoPath 2010.
This also means that if you start out creating a normal Blank Form template for example and then afterwards realize that you want to submit the form data to a SharePoint list, you will have to recreate your form template as a SharePoint List form template. Be aware of this and decide beforehand what your form template is going to be used for and how it is going to be submitted before you start designing it.
The SharePoint List form template allows you to either view/edit a single item or multiple items. You can select the latter option when you create a form template from within InfoPath. If you customize a form for a SharePoint list from within SharePoint, you will only be able to customize a SharePoint List form template to view/edit a single item.
So if you want to create a SharePoint List form to view/edit multiple items within a SharePoint list, create this form template from within InfoPath (see method 1 mentioned above).
Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent of S.Y.M. Wong-A-Ton. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author, S.Y.M. Wong-A-Ton.
Related InfoPath Articles:
- Filter and sort a SharePoint list in InfoPath using a DataView
- How to delete SharePoint list items via an InfoPath browser form using the SharePoint Object Model
- How to update a SharePoint list via an InfoPath browser form using the SharePoint Object Model
- How to use the SharePoint object model to submit data from an InfoPath browser form to a SharePoint list
- Programmatically create a custom SharePoint list from a repeating table in an InfoPath web-based form