Search This Blog

Thursday, December 4, 2014

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!

No comments:

Post a Comment