Promote InfoPath form fields to a SharePoint library
Learn how to promote fields in InfoPath to a SharePoint form library and get answers to frequently asked questions about InfoPath form field promotion for use in SharePoint 2010 or a workflow.
Promoting an InfoPath form field entails linking that field to a column in SharePoint, so that the value of the field can be accessed in SharePoint without having to directly open the form.
You can watch this InfoPath form field promotion and workflow video tutorial for a complete example of promoting an InfoPath form field and then using a SharePoint Designer 2010 workflow to retrieve the value of the promoted field to add an item to a SharePoint list; or watch this promote InfoPath field as editable SharePoint column video tutorial on how to make a field editable in the properties page or a datasheet view.
What do promoted InfoPath form fields allow you to do?
InfoPath field promotion allows you to do 3 things:
- Display the values that are stored in InfoPath form fields directly as values in SharePoint form library columns. This makes it easier to immediately see the data that is stored in an InfoPath form without having to open the InfoPath form itself.
- Edit data that is stored in an InfoPath form directly from a datasheet view or properties page of an InfoPath form. This makes it easier to enter data into an InfoPath form without having to open the InfoPath form itself. The disadvantage of using such type of data entry is that business logic (so rules; especially validation rules) that has been defined in an InfoPath form does not work in the properties page or the datasheet view.
- Get data from an InfoPath form that a SharePoint Designer workflow is running on, or have a SharePoint Designer workflow write data to an InfoPath form it is running on.
How do you promote InfoPath form fields to SharePoint?
There are two ways you can promote InfoPath form fields to SharePoint:
- Use the Form Options dialog box.
- Use the Publishing Wizard.
The Form Options dialog box is good to use to define or pre-define InfoPath form fields that should be promoted to new columns on a form library or content type when publishing a form template as a site content type.
Whether you use the Form Options dialog box or not, you can always alter or define promoted fields afterwards via the Publishing Wizard during the form template publishing process.
The Publishing Wizard offers more flexibility than the Form Options dialog box when it comes to InfoPath form field promotion, so I recommend using the former.
For more in-depth information on how to promote InfoPath form fields, see recipe 23 and recipe 24 of InfoPath 2010 Cookbook 2.
What kind of column should you promote a field to?
At the most fundamental level, there are 2 types of columns you can promote a field to:
- List column.
- Site column.
List columns are columns that are private to a list or SharePoint form library in this case, and site columns are columns that exist within the context of a SharePoint site, so which can be added to any list, library, or content type. Site columns are basically reusable columns.
When promoting to a list column or a site column, the column can be created as a new column on a SharePoint form library or content type; or you can promote a field to an existing column on a SharePoint form library or content type.
Whether you choose to promote to a list column or to a site column depends largely on your scenario. If your scenario calls for column reuse, it is best to use a site column for field promotion. And when you are publishing to a site content type, you typically would also use a site column to promote InfoPath form fields.
Frequently asked questions about promoting InfoPath fields
How to promote an attachment control in InfoPath?
File attachment controls or base64 encoded fields are fields you cannot promote to SharePoint, since they are not supported. Not all types of fields can be promoted to SharePoint.
How to promote a repeating table?
You cannot promote rows of a repeating table to SharePoint, because SharePoint does not support the repeating table data structure. Since you can only promote one value to SharePoint, InfoPath provides functions you can use to promote repeating table data. You can choose to:
- Promote the amount of rows (so a number) to SharePoint.
- Promote the first repeating field in the repeating table to SharePoint.
- Promote the last repeating field in the repeating table to SharePoint.
- Promote all of the values of a column in a repeating table as one merged field. The values from each repeating field in one column will then appear as multiple lines of text in SharePoint.
There are also aggregate functions (sum, average, min, max) you can use when promoting repeating table fields, but then those fields must be of a numeric data type.
How to promote a multiple selection field?
Promoting the repeating field of a multiple-selection list box is similar to promoting a repeating field of a repeating table to SharePoint, so you can refer to the question about repeating table field promotion above.
How to promote person/group field?
Promoting the repeating field of a person/group picker control is similar to promoting a repeating field of a repeating table to SharePoint, so you can refer to the question about repeating table field promotion above.
How to set promoted column value in workflow?
First you need to make sure that when you promote the field in InfoPath, you select the option to edit data by using the properties page or datasheet view. Then in SharePoint Designer, you can use a Set Field in Current Item action to set the value of the promoted InfoPath form field via the workflow.
InfoPath unable to promote number field with allow users to edit data in this field by using a datasheet or properties page
When you are promoting InfoPath form fields for editing in SharePoint, you must ensure that the data types of InfoPath form fields you want to promote match the data types of the columns in SharePoint.
For example, if you have a field in InfoPath that has been defined as a Whole Number (integer) field, you must ensure that the column to which you promote the field in SharePoint has the data type Integer assigned to it (see Table 3 in the discussion section of recipe 23 of InfoPath 2010 Cookbook 2 for a list of matching data types).
Learn more about InfoPath form field promotion
To learn more about InfoPath field promotion in relation to SharePoint form libraries, content types, InfoPath controls, and SharePoint Designer workflows, see Chapter 2 and Chapter 5 of InfoPath 2010 Cookbook 2 or InfoPath 2013 Cookbook 2.
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.