
Sometimes you need cascading dropdown boxes with predefined values, ofcourse it would be great to add this to a database or link it to a webservice, but it is not always possible.
A solution to this is to use Resources in InfoPath.
Example
The example is use here is coming from Darrin E. (otherwhise I had to invent some case myself)
Combo1 will be filled in with some predefined values (Dairy, Meats, Cans), depending on the value selected in this combo 1, predefined values in combo 2 will be showed. No external webservice, no database connection, no sharepoint. Ex. when Dairy is selected, combo 2 should contain Lowfat, 2% and whole milk, if meat is selected, beef..pork… should be showed in combo 2 etc.
The problem is not to create cascading dropdown boxes, many people explain this on the internet., but we are going to explain how to do this with resources
1. Create an xml with the data
<root>
<group1>
<combo1>Dairy</combo1>
<combo2>Lowfat, 2%</combo2>
</group1>
<group1>
<combo1>Dairy</combo1>
<combo2>whole milk</combo2>
</group1>
<group1>
<combo1>Meats</combo1>
<combo2>beef</combo2>
</group1>
<group1>
<combo1>Meats</combo1>
<combo2>Pork</combo2>
</group1>
<group1>
<combo1>Cans</combo1>
<combo2>large</combo2>
</group1>
</root>
2. Create a new InfoPath template, add 2 combo boxex. Combo1 and Combo2
3. Click on the menu Tools -> Resource Files
4. Click Add and select the previous created Xml file
5. Click Ok to close the popup box
6. Click on Tools -> Data Connections
7. Click Add
8. Click Receive Data + Next
9. Select Xml Document + Next
10.Click resource Files button and select the previous add resource file
11. Click Next and Select the checkbox “Automatically retrieve data when the form is opened“
12. Click the Finish button
Click the Close button
This is it. No we have to bind the dropdown boxes to the secondary DataSource.
Using filters in the Combo2 and don’t forget to check “Show only entries with unique display name” for combo 1