Cascading Drop-Down List in SharePoint 2010 using InfoPath 2010

Cascading drop-down is a common business requirement. SharePoint 2007 does not support cascading drop-down list by default. User have to write custom SharePoint field and it’s not easy to implement. With SharePoint 2010, User able to customize SharePoint form in easy way by using the powerful of InfoPath Designer. Following is the step guides to create a cascading drop-down list solution in SharePoint 2010 without require a lot of IT knowledge.

Scenario: We build a cascading for Address List. We have three list: City, District and Ward

1. Create City List

- In SharePoint 2010, create a custom List and named as “City”

- Add Two Item to this list: Hanoi and TP HCM

2. Create District List

- In SharePoint 2010, create a custom List and named as “District”

- Create a Lookup column named as “City”. This column get information from City List in the column Title.

- Add 4 items to District list

image

3. Create Ward List

- In SharePoint 2010, create a custom List and named as “Ward”.

- Create a Lookup column named as “City”. This column get information from City List in the column Title.

- Create a Lookup column named as “District”. This column get information from District List in the column Title.

- Create on Add new Item link you will see. When we choose City, District still have 4 item.

image

4. Customize Ward form to meet cascading requirement

- In Ward List, click on Customize Form ribbon button

image

- System will automatically open the form template of Ward list in InfoPath Designer

image

- Right click on District drop-down list control then select Drop-Down List box Properties from menu to open the properties windows

image

- In Data Source. Click on Add button

- In Data Connection Wizard, click on Next button

image

- In Select the source of your data, choose SharePoint library of list then click Next button

image

- In SharePoint Site details screen, click on Next button

image

- In Select a list of library, choose District the click on Next button

image

- In select fields: Choose Title, City, ID then click on Next button

image

- In next screen, choose Next button

image

- Leave the default name for the connection as “District1” then click Finish button

image

- Now, You will see the Data Source of Drop-Down list box is District1

image

- In Entries section, click on the tree button to select XPath

- In Select a Field or Group dialog, click on Filter Data… button

image

- In Filter Data click on Add… button

image

- In specify Filter Conditions, in the first drop-down list choose Select a field or group

image

- Select a Field or Group opened. Select District1 as Data Source, choose City in dataFields then click OK

image

- In specify Filter Conditions, in the last drop-down list choose Select a field or group

image

- Select a Field or Group opened. Select Main as Data Source then choose City in dataFields then click OK

image

- Click on OK to close specify Filter Conditions dialog

- Click on OK to close Filter Data dialog

- Click on OK to close Select a Field or Group

- In Drop Down List box properties, choose d:ID in Value: section then click OK to close this

image

- In InfoPath Designer, close the Windows then choose the Save and Publish button

image

- After Publishing complete, back to Ward list then click on Add new item link. You will see the result

image image

Two drop-down list has been cascading.

Conclusion

SharePoint 2010 provides a easy way for none IT to custom the look and feel of SharePoint by using InfoPath Designer, SharePoint Designer. Customize form in InfoPath Designer 2010 is a great new feature of SharePoint 2010. It’s cool!

About these ads
This entry was posted in InfoPath, SharePoint. Bookmark the permalink.

30 Responses to Cascading Drop-Down List in SharePoint 2010 using InfoPath 2010

  1. Julie Barker says:

    Ok, here’s the deal I don’t have infopath installed on the server or local desktop (hosted external server). Is there a way to do the cascading dropdown WITHOUT using Infopath?

  2. Siyasanga says:

    Hello, Great tutorial I love it. I did all this and It’s working perfectly. My problem is that I want to change this form template to a content type and add that content type to a document library so that when users may choose these options when submitting documents. When you start an Infopath form from Office Infopath it does allow you to publish it to SharePoint as a Content Type but you can’t do cascading dropdown. On the other hand, when you edit Infopath form from a SharePoint List(As you did in your tutorial) it does not allow me to Publish this form as a content type.
    I want both cascading dropdowns and to also publish it as a Content Type, How can I go about doing that ??

  3. Mycah82 says:

    I am using InfoPath 2010 and SP 2007. My filtered field keeps returning blank after following your instructions. Please let me know if you have suggestions.

  4. Tyler says:

    Doing this I cannot actually add an item as the District gives and error showing Only posative intergers allowed. I can select the City fine, but the District gives this error and won’t let you create the item.

    • Tyler says:

      Actually, I missed a step that caused the issue.

      - In Drop Down List box properties, choose d:ID in Value: section then click OK to close this

      Now that I have done this it works great. Thanks!

  5. Larry says:

    Yes, works, but how do you change or remove the tool tip “Only positive intergers are allowed”

  6. Pingback: Good Blog Post on Cascading Dropdowns in InfoPath 2010 | Led to Slaughter

  7. Vivek says:

    This works for me… One thanks for google and a tonnes of thanks to you !! you saved me from some trouble…

  8. Asif says:

    Many Thanks, it woked for me.

  9. Yep worked for me, even with Multiple select!!

    Thanks very much

    • Chris D says:

      Marcel–you got MULTIPLE select to work! Oh man, how’d you do it? In infopath 2010, a multiple selection box is not an option for me! when i try and change the field, just as demonstrated from above, it says ‘you must pick a repeating field!’ :(

      • Chris D says:

        let me rephrase–i can add multiple select controls, but i can’t seem to convert the drop down menu to one.

      • Chris D says:

        nevermind! got it! just add a new control and bind that one. Duh! Thanks all.

      • Jerry says:

        ChrisD – can you email or post how you were able to convert the child field from a single drop down lookup field to a multiple select field? I have a requirement to be able to pick multiple choices presented after the initial filter is applied. Thanks!!!

      • Jerry says:

        never mind! got it to work now too :) my only problem is that I would like to allow selection of multiple items that are located in different groups, however the checked items get a bit wacky when the parent filter changes…:\

  10. Huzefa says:

    Works like a charm…. Thanks

  11. Craig Leader says:

    Very useful, I was fighting with this for a week thank you!!!!:D

  12. Sunil says:

    This helps part of what i am trying to do… My second selection should give me specific questions. How do i do it using infopath ? For example i want selection of a specific field form the second drop down to pop up a set of questions

  13. Awesome! Easy to follow and worked perfectly the first time! Thank you!

  14. Kirk Jacobson says:

    Works the first time you select a City from the list, but when changing the city after selecting a City and District, random numbers start appearing in the District list.

  15. AJ says:

    Thank you so much for this!
    I’m having trouble getting it to work in datasheet view, though – is that to be expected?

  16. Damian says:

    I get to the last step and cannot change the Value to d:ID or anything else. If I click the button next to the values field in the properties box, it shows just one value from the data connection and does not display in the field when selected., So, I get nothing but blanks,

    • Fernando says:

      Probably you have selected an item instead of a group. Look carefully to the instructions. It happen same to me. Choose the group, the one with the “+”

  17. I was suggested this blog by my cousin. I am
    not sure whether this post is written

    by him as nobody else know such detailed about my problem.
    You are

    wonderful! Thanks!

  18. An impressive share, I just given this onto a colleague who
    was doing somewhat evaluation on this. And he actually purchased me
    breakfast as a result of I discovered it for him.
    . smile. So let me reword that: Thnx for the treat!

    However yeah Thnkx for

    spending the time to discuss this, I feel strongly about it and love studying more
    on this topic. If possible, as you turn out to be expertise, would you thoughts updating your weblog with
    extra

    details? It is highly useful for me. Large thumb up for this

    weblog submit!

  19. Amy says:

    Have been trying for two days to make it work on an InfoPath Form of a workflow i.e. instead of the third list ‘Ward’ I have to create the filters directly on the InfoPath form that is created by the workflow. However the filters do not work as expected. I cannot get the cascading as expected. Any suggestions?

  20. munirathinam says:

    Nice blog… Thank You

  21. Today, I went to the beach with my kids. I found a
    sea shell and gave it to my 4 year old daughter and said
    “You can hear the ocean if you put this to your ear.” She put
    the shell to her ear and screamed. There was a hermit crab inside and
    it pinched her ear. She never wants to go back!
    LoL I know this is completely off topic but I had to tell
    someone!

Comments are closed.