InfoPath 2010 SharePoint list data connection

Applies to: InfoPath 2010

Learn how to add an InfoPath 2010 SharePoint list data connection to a SharePoint list or library.

ADVERTISEMENTS

Problem

You want to create an InfoPath 2010 SharePoint list data connection to be able to display data in a control (for example a drop-down list box or a repeating table) on an InfoPath 2010 form.

Solution

Create a Receive InfoPath 2010 data connection to a SharePoint list.

Discussion

The first step to display data from an external data source such as a SharePoint list within an InfoPath form is to add an InfoPath data connection to that external data source to the InfoPath form template. And for this, you must add a Receive data connection to the InfoPath form template.

Once you add a Receive data connection to an InfoPath form template, it becomes a secondary data source of the form template.

The steps for creating an InfoPath 2010 data connection have not changed much from the steps to add a data connection to a SharePoint list or library in InfoPath 2007, as you will see shortly if you are familiar with how it is done in InfoPath 2007.

Before you begin, ensure that you have created a list in SharePoint 2010 or that you have a SharePoint list available that you can use while performing the steps below.

To create an InfoPath 2010 SharePoint list data connection:

  1. In InfoPath Designer 2010, create a new Blank Form template.
  2. On the Data tab under the Get External Data group, click From SharePoint List.

    From SharePoint List button on the ribbon in InfoPath 2010

    Figure 1. From SharePoint List button on the ribbon in InfoPath 2010.

  3. On the Data Connection Wizard, type in the URL of the SharePoint site where the SharePoint list you want to connect to is located, and click Next.
  4. On the Data Connection Wizard, select the SharePoint list or library you want to connect to, and click Next.
  5. On the Data Connection Wizard, select all of the fields from the SharePoint list from which you want to display data on your InfoPath form, and click Next.

    Selecting SharePoint list fields from a data connection in InfoPath 2010

    Figure 2. Selecting SharePoint list fields from a data connection in InfoPath 2010.

  6. On the Data Connection Wizard, select Store a copy of the data in the form template if you want the InfoPath form to be able to still display cached data when no connection to SharePoint is available, and click Next.
  7. On the Data Connection Wizard, change the name for the data connection if you wish, and click Finish.

With this you have added an InfoPath 2010 SharePoint list data connection to your InfoPath form template. This InfoPath data connection will be listed on the Data Connections dialog box. To view it, on the Data tab under the Get External Data group, click Data Connections to open the Data Connections dialog box and view the data connection you have just created.

You could have also created the InfoPath 2010 SharePoint list data connection by clicking Add on the Data Connections dialog box and then following the instructions on the Data Connection Wizard to create a Receive data connection to a SharePoint library or list. Using the From SharePoint List button on the ribbon will save you 4 clicks.

 


Related InfoPath Articles:

 

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. 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.

InfoPath 2013 Cookbook: 121 Codeless Recipes for Beginners

InfoPath 2013 Cookbook 2: 121 Codeless Recipes for SharePoint 2013

InfoPath 2010 Cookbook: 101 Codeless Recipes for Beginners

InfoPath 2010 Cookbook 2: 101 Codeless Recipes for SharePoint 2010

InfoPath 2010 Cookbook 3: 101 Code Recipes for C# Developers

InfoPath 2010 Cookbook 4: 101 Code Recipes for VB Developers

InfoPath 2010 Cookbook 5: Integrating InfoPath with Excel and Excel Services