I started using SharePoint in 2009, since then I have branched out to incorporate InfoPath, SharePoint Designer, System Center Orchestrator and System Center Service Manager to expand and optimize work within my company.
Sunday, February 16, 2014
InfoPath: Field Dependencies or Parent Child look ups
While collecting requirements for the new laptop deployment site I was asked if there was a way to allow different laptop model options other than the 4 standards we offer.
The idea was to allow each service line their own customized laptop options to prevent people from requesting laptops the service line does not have on hand or laptops they do not want their users to request.
The solution is to set up a set of dependencies that filter the information according to previous selections.
Let's start out with the list we want to submit:
Create a simple (requests) list with three columns all Single Line of Text entries
Then create the secondary (Information) list where we will gather this information we want to have dependent on each other.
Using Datasheet view, populate the information list with the dependencies. In this case it will have
Give each region at least two Service Lines
Give each service line at least two Laptop options
Now we will attach these data points to the Requests List. This change can be made by customizing the list with InfoPath
The list should look like this:
Currently each of these fields are simple text and do not actually reference anything and can be filled out with anything. We want to bind them to the other list and its options:
Under the Data ribbon go to Data Connections
Add a connection
Create a new Connection to:
SharePoint Library or List
Enter your site if not already there
Find your secondary list (requests)
Select the columns you want to bring over from the secondary List
Leave the next two sections as default and then finish
Now we need to associate each field on the list with it's the column information from the secondary list
Right click on the region box and under Change Controls select Drop-Down List Box
Right Click again and select properties at the bottom.
Select Get Choices from an External data source, under Data Source select the Data connection you made earlier (Information)
Under the entries tree select region and then check the box that says Show only entries with unique display names
This will now display the three region options on the form
Repeat steps 1-3 for Service Line
However when you go to select the entries value you will add a step
Once you select Service Line then you will select Filter Data below.
In specify Filter Conditions
Select Region in the first drop down
is equal to in the middle drop down
Choose Select in a field or group for the last drop down
Change the field to Main
Then chose the Region Field
OK all sub menus until you are back in the original properties menu
Select "Show only entries with unique display names"
Now the Service line is option cannot be selected unless the Region field is completed
And it will only show service lines that are under the region you selected.
This same process can be applied to the laptop options by selecting the service line under the filter options