Suppose you want to have the items listed in a drop-down be dependent on the selection of another drop-down (this is also known as "cascading dropdowns). If you have InfoPath Service Pack 1 installed, you could use the "Filter Data..." feature to accomplish this.
You have one drop down labeled "State:" with the names of states and another drop-down labeled "City:" which gets populated with the names of the cities for the state you selected on the previous drop down.
The city drop-down obtains its values from an xml file which might look something like this:<Cities> <City state="Washington">Redmond</City> <City state="Washington">Seattle</City> <City state="California">Los Angeles</City> <City state="Florida">Orlando</City></Cities>
For the two above comments: in InfoPath 2003, you need to employ an XPath current() function, described in this article:
InfoPath 2007 will do this for you.
I have created an InfoPath form and have a specific field linked to another site via a data connection from where I collect a set of alphanumerical codes (ex: WTR001A, GDL542B). I want to semi filter the codes. I don’t want to sort them alphabetically for now, just worry about filtering the options upon selection of a specific building location.
My 1st filter field asks the user to select a building location which are:
• AMS = Americas
• BA = Buenos Aires
• BCN = Barcelona
Upon the user’s selection I want the “codes” mentioned above to display only the ones pertaining to that building location. Perhaps having a XML file that specifies if a user selects Barcelona, then only show BCNXXX “codes” if a user select Singapore, then only SGPXXX codes show
Would an XML file work? If so how would it look like?
Thank you man that was a good article
how do I create the xml the city drop down obtain its values from?
I do this 'filter' and it returns only 1 row in the drop down, while it should return 4 or 5 different values in the dropdown.
PS: using Infopath 2010.
I want to do something similar to this but using a check box to filter the 2nd drop list. Any help on how to make that happen?
If you are interested in learning advance use of drop down list with Conditional Formatting
on the state property, if I add a rule to set City to empty, it does not change at all, the first few selected cities stays there forever.
Any way to get this to work from Excel?