Step 3: Connect dropdown lists to SharePoint lists

In this step we'll be using InfoPath and connecting the drop downs in the forms to the SharePoint Lists created in previous steps.

  1. In InfoPath, on the Ribbon, click Form, and then click Manage Data Connections.
  2. Click Add.
  3. Under Create a new connection to: select Receive Data.
  4. Select SharePoint library or list.
  5. Enter the path to your SharePoint site (for example, http://server/forms/lists), and then click Next.
  6. Under Select a list or library, select a SharePoint list and then click Next.
  7. Check the box for each field you wish to add (see below for our example), and then click Next.

  8. Under Type a name for this data connection, type a name for the data connection.
  9. Check the box next to Automatically retrieve data when form is opened, and then click Finish.

Convert the list to a drop down

Now that we have established a data connection, we'll go to the field marked Country Key, and then convert it to a drop down list. We'll also filter the list to show only the state or regions that correspond to the selected country.

  1. Right-click the Country_Key field, and then click Properties.
  2. Select Get Choices from External Data Source.
  3. Select Data Source: Countries.
  4. Specify the value and display name.
  5. Check Show only entries with unique display names. (This helps filter entries.)
  6. Click OK.

 

Drop down list box properties

Create a regions filter

For this phase we will essentially repeat what was done for Countries and apply it to a new dropdown called Regions.

Follow the same basic procedure outlined above for creating a data connection to a SharePoint list and then converting it to a dropdown.

After creating the Region and State fields to drop down lists, we create a filter to show only the state or regions that correspond to a selected country.

 

  1. In InfoPath, select the control that you want to filter.
  2. Under Control Tools, on the Properties tab, in the Properties group, click Control Properties.
  3. Next to the Entries box, click Select XPath Infopath Xpath icon
  4. Select the field or group that contains the desired values for the control, and then click Filter Data.
  5. Click Add.

    NOTE: If you want to add a condition to an existing filter, click the filter that you want, and then click Modify.

  6. In the first box on the Specify Filter Conditions dialog box, click the name of the field (see example below) whose data you want to filter.

  7. In the second box, click the type of filter that you want to use.
  8. In the third box, click the type of condition that you want to apply to the filter, and then type the condition.

    In the previous example, the contents of the control are filtered so that the contents of the Category field are equal to the contents of the category field in the data source.

  9. If you want to specify additional criteria for the filter, click And, and then specify the desired criteria.

    If you do this a fourth box appears. Click a modifier, and then click and (if both conditions should be applied to the filter), or click or if (if either condition should be applied to the filter).

The properties for our example Drop down list are shown below.

Adding a Terms of Payment data connection

In this final part, we've simply repeated the previous process and added additional connections for:

  • Terms of Payment
  • Currency
  • Reconciliation

At this point we have created data connections and drop downs for every field.