This is one in a series of posts on using InfoPath. If you are new to SharePoint lists and InfoPath you might want to start with the Best Practices.
Best Practices for Cascading SharePoint Lists using InfoPath Forms
Use a SQL Server data source for an InfoPath pick list
Continuing with the same example I used in the Best Practices post, I’m going to make a change to an existing InfoPath form. Navigate to the SharePoint list called Supply Chain Scorecard Metrics and add a new item. In the Section drop down, notice that I’ve included the Goal as part of the Section description (Goals are Improve, Maintain and Track).
What I could do is have the user choose the goal, and then filter the Section list to show only those Sections which have that Goal. Here’s how we can do that.
ADD THE GOAL TO YOUR LIST
Navigate to your Supply Chain Scorecard Metrics list and in the List menu click on the List Settings. Add a column called Goal_ID with type of Number. Require that the column contains information. When the user selects a Goal we will store the Goal ID in the Metrics list, and then use that to filter the drop down list of available Sections the user can choose from.
ADD THE GOAL TO YOUR FORM
Navigate to your Supply Chain Scorecard Metrics list and in the List menu click on the Customize Form button to open up the InfoPath form.
Click OK and enter a password if necessary. Click Yes when it asks if you want to update the fields from the SharePoint list.
Add a row to your InfoPath form above Section by highlighting the Section row, right click and select Insert –> Rows Above.
From the Fields window, drag the Goal_ID field into the right hand cell in the row you just created.
Delete the label that says Goal_ID:, and type in Goal in the cell to the left of the Goal_ID textbox.
Right click on the Goal_ID text box and select Change Control –> Drop-Down List Box
Right click again and select Drop-Down List Box Properties.
Select Get choices from an external data source and then from the data source drop-down choose Supply Chain Scorecard Section.
Set Value = Goal_ID and Display name = Goal. Check the box that says Show only entries with unique display names. Click OK.
FILTER THE SECTION CHOICES BY THE GOAL SELECTED
Right click on the Section drop down list box and select Drop-Down List Box Properties.Beside the Entries box, click on the tree icon.
Click on the Filter Data button.
Click on the Add button.
Now we will specify on what to filter the Section list. In the first drop down select Goal ID. Leave the second drop down as “is equal to”. In the third drop down select “Select a field or group”
Change the data connection in the drop down to Main. Navigate to dataFields and then to Goal_ID.
Click all of the OK buttons. Publish your InfoPath form.
Add a new item. Select Improve as your Goal. Notice that the Section drop down has only those Sections that have a Goal of Improve.
And that is how you filter a drop down from another value in your list.