Introduction
In the previous article InfoPath Forms 2013-Part 1 I have demonstrated how to create a simple InfoPath form. In this article we will explore the various methods to fill a dropdown list in an InfoPath form.
Various methods to fill the Dropdown list
Here we must add a new field country in the form and right-click on the control and there is an option like Change control and we can select which control we need. In this case I selected drop down list.
After that we must select the dropdown list properties.
In the List box choices we have the following three options:
- Enter choices manually
- Get choices from fields in this form
- Get choices from an external data source
Here first we are selecting enter choice manually.
Here we can add values for the dropdown list.
After that we show the values in the dropdown list.
Get choices from an external data source
In this option we can fill the dropdown list using an external data source. Here we are filling the dropdown list using a SharePoint list.
If you have already created a connection then select it from here.
Otherwise we need to create a new connection.
Here we select the option SharePoint Library or list.
Enter the Site URL here.
Here we need to select the list or library that you want to fill with the dropdown list values.
Select the field and here we have the options for sort in descending or ascending order and to sort by any field in this list.
Enter the name of the data connection and check the check box for automatically retrieving the data when the form is opened and click the "Finish" button.
Then "Apply" and click the "Ok" button.
Here we can show the SharePoint list values that we selected for filling the dropdown list.
Here we will see the dropdown list filled with SharePoint list values.
Summary
In this article we have explored the various methods to fill the dropdown list in InfoPath forms.