You are here: Getting Started > Tutorials > Tutorial 3: Building advanced forms and workflows > T3-9. Create a SharePoint list and data connection

Tutorial 3–Step 9: Create a SharePoint list and data connection

In this tutorial you will add a SharePoint data connection to your form. (Note that you will need to create a SharePoint list for this exercise. Consult your SharePoint documentation if you need assistance.)

Create the SharePoint list

  1. Create a SharePoint list called Department.
  2. Open the Time Off Request solution.
  3. On the Designer toolbar, click Launch InfoPath.
  4. In the Fields Navigation Pane, under Actions, click Manage Data Connections

  5. In the Data Connections dialog box, click Add.
  6. The Data Connection Wizard starts. Make sure both Create a new connection to: and Receive data are selected, and then click Next.
  7. Select SharePoint library or list
  8. Navigate to the Department SharePoint list created at the beginning of this exercise.
  9. On the Ribbon, in the Settings section, click List Settings.

  10. In the Columns section, click Title

  11. Change the Column name from Title to Department, and then click OK.

  12. In the breadcrumbs navigation links, click Department to return to your list.

  13. On the ribbon, click List.
  14. On the left hand side under the View Format section, click Datasheet View.

  15. Under the Department column, make the following 3 entries as shown below:

  16. After you have finished creating the entries, copy the hyperlink to your Department list from the browser address bar, and then return to your Time Off Request Form.
  17. Paste the link to your Department list into your SharePoint list in the text field, and then click Next.

  18. In the Select a list or library box, select your SharePoint list (Department), and then click Next.

  19. In the Select Fields window, select the Department check box, and then click Next.

  20. Make sure Store a copy of the data in the form template is NOT selected, and then click Next.

  21. Select Automatically retrieve data when form is opened is selected.
  22. Click Finish.
  23. Close the Data Connection window.

Connect your form to your SharePoint list

Back to top

  1. In your Microsoft InfoPath form, insert another row under Full Name.
  2. In the left hand side, type the text Department and insert a Drop Down List Box in the cell to the right.

  3. Rename the new drop down list box to Department.
  4. Under List box choice, select Get choices from an external data source.

  5. Your data connection to the SharePoint List Department should be automatically populated.
  6. In the Entries field, click the Select XPath button ()
  7. Expand the Department folder, click Department to select it, and then click OK.

  8. Click OK.
  9. Save your form and then preview it.