So if you want to keep it simple or are not terribly technical follow these steps to create cascading drop downs within SharePoint 2010.
The first thing you will need is a SharePoint 2010 list to populate the drop downs. Basically it works like this: Each Item and it's respective columns will filter the items in the following drop downs. For this example I have created a 'location' list called 'suburbs'.
There are two other metadata columns that define the suburb: State and Country.
The way the cascading drop downs will work in InfoPath is that the first selection will be 'Country' which will then filter the second drop down, 'State' which in turn once slected, will give the user filtered option in the third drop down; Suburb.
The List
Custom list created with two additional metadata choice columns (Country and State).
List with some sample data:
To create the cascading drop downs in the form you will first need to create 3 empty datafields.
Add the three drop downs of the fields to the form. To populate the form with the columns from the list create a new SharePoint list data connection, which can be found under the 'data' tab.
Now right click on the first drop down and go to Drop Down List Box properties. Select 'Get Choices from an External Datasource'. Select 'Suburb' (this will be automatically selected if it is your only external datasource). For the first 'Country' drop down select 'Country' as the value and display name and also check the box 'Show only entries with unique display names' (this will avoid duplication).
Now right click the 'State' drop down, follow the same procedure as before except this time select 'State' for value and display. However when you select the 'State' option, you will need to click on the 'Select XPath' from next to the 'Entries' box. This will allow you to filter the 'States' based on the selected Country.
Select the 'Title' drop down and then click on 'Select a field or group'.
However, first follow the procedure above to change the third drop down to display 'Suburb' fields and filter them agaisnt the field selected in the 'State' drop down box.
Now to create the rule that resets the other two drop downs when you reselect the first 'Country' one.
Right click on the 'Country' drop down and select 'Rules' > 'Manage Rules'. A new side panel will appear on the right which allows you to manage the rules of this particular field element.
24 comments:
Thanks! Your explanation was the only one I could follow:-)
Hi Koobar - thanks for that, this approach was nice and easy to follow, but when I publish InfoPath indicates the filtering isn't compatible with web browser. Waht else do i need to do to ensure this works in the web browser, not just the InfoPath filler? :)
I see that there has been no replies from the author on Bruce's comment. I am having the same issue, it give me errors saying that filtering is not available in browser based forms.
Thanks for your valuable article. I have slightly different requirement. I have two lists (country and states; not within the same list like your post) linked with a column. I applied your logic to my requirement but it's not filtering. Any idea?
Thanks.
Filtering is NOT supported on browser-based InfoPath forms... so this is not the solution for browser based InfoPath forms...
Amazing BOSS just i was searching for this ............thank u very Much...........? Keep on Good work
Amazing Boss thats Helped gREAT FOR MEE.............
Amazing Boss .....its helped alot for me..............keep on good work.....
Thanks! You saved my Time and Hair;-)
my question is that, once the 1st, 2nd and 3rd dropdown are selected..and if we go back and change the 1st dropdown to other value..the previous values of 2nd and 3rd dropdown for previous 1st dropdown value are stored and if we save it..those values will be stored..Can we get any pop up message or any warning message to change the value ?
Really Helpful...Thanks.....
I think that the use of the word "Metadata" has confused the issue. The fields he created in the list are just text columns in the list, not true metadata. That being said, the solution does work with the text fields.
I tried the solution and it worked. Be sure that you are designing a 2010 Infopath form template and not a 2007 InfoPath form template.
Koobar - thank you so much. This works beautifully.
"Filtering is NOT supported on browser-based InfoPath forms... " is wrong. It works in browser-based forms. I checked it few times
very helpful. thank you!!
This worked great for me in one instnace, but in a second implmentation I'm having a wierd issue. For the second use of it I added two people picker fields and and have two fields in the InfoPath form to use the value of that list item in those fields. When a new form is opened, if the user does not have Full Control of the list the form uses as a data connection, the dropdowns are all blank. As soon as I give the user Full Control, the user is able to see the filtered dropdown. Anyone have any ideas?
Thank you thank you thank you! This is the best explained lesson I've come across. Thanks so much!
but in this scenario , if suppose i want to fetch the second drop down list from the lookup field. how it poosible.? i tired it but it shown only the id vales , not a text value of particular drop down. can u help me..
Quantum Binary Signals
Get professional trading signals sent to your mobile phone daily.
Start following our signals NOW and profit up to 270% daily.
Post a Comment