Cascading Drop Down List In SharePoint 2010

SharePoint 2010 has provided lot of things Out-of-box and it’s just a matter of configuration.But some times we don’t know how to achieve that functionality. Today We will discuss Cascading  Drop down List in SharePoint 2010.

Result

As we know InfoPath as a Microsoft Office product features a different usage-scenario from the other Office applications, such as Word and Excel. In order to use InfoPath to fill in a form, a user must have a designer develop an InfoPath template first.

All the data stored in InfoPath forms are stored in an XML format, which is referred to as the “data source”.

InfoPath provides several controls and For each controls, actions (called “rules”) can be bound in. A rule defines a specific action that will be performed under certain conditions.  So we will Achieve our goal using Infopath forms.

So will follows following steps :-

  • Create a Custom list called ‘states’.
  • Add States to the list: Maharashtra, Uttar Pradesh, Rajasthan, Gujrat etc..

statelist

  • Create another list for Cities and called ‘cities’.
  • Go to the list settings of ‘cities’ and click on ‘create column’. Create a Lookup column called ‘State’. with following information. Get information from: ‘states’,  in this column: ‘Title’

list_Column

list_

  • Add some cities to this list. I created multiple cities at each location.

Newitem

citieslist

We have need to create one more Custom List where we apply this …

  • create a new Custom list called ‘MyHomeTown’.
  • Click on ‘Create column’ and create a Lookup column called ‘State’. Get information from: ‘states’,  in this column: ‘Title (as earlier screenshot )
  • Repeat above step, for create a Lookup column called ‘City’. Get information from: ‘cities’,  in this column: ‘Title’

citylookup

citylookup_settings

  • Open the list settings for ‘MyHomeTown’ and click on ‘Form settings’.
    You will see a label with the text ‘Customize the current form using Microsoft InfoPath’. Click OK.

formsetting

customize the current form

  • The MyHomeTown form will now be opened in InfoPath 2010.

infopath

  • Right click on the State field, and select properties.
    Select ‘Get choices from an external data source’ and click ‘Add…’.
    Create a connection with the following settings:-

ControlProperties

stateInfopath_PropSetting

1. New connection, receive data

CreateNewConnection

2. Receive data from: SharePoint library or list

SourceOfData

3. select ‘states’ library

statesLib

4. select the ‘id’ and ‘title’ column.

AddIdAndTitle

5. Do not check the box for making a copy of the data.

StoreACopyOfData

6.check the box that asks for automatically retrieving data when the form is opened. Save the external data source as ‘states1′

AutomaticalltRetrieve

  • At value, choose ‘ID’ and at display name, choose ‘Title.
  • Right click on the City field, and select properties.
    Select ‘Get choices from an external data source’ and click ‘Add…’.
    Create a connection with the following settings:

1. New connection, receive data

CitiesInfopathProperties

2. Receive data from: SharePoint library or list

SourceOfData

3. select ‘cities’ library

citieslib

4. select the ‘id’, ‘title’ and ‘State’ column.

titleIdState

5. Do not check the box for making a copy of the data in the form Template.

StoreACopyOfData

6. do not check the box that asks for automatically retrieving data when the form is opened. Save the external data source as ‘cities1′

AutomaticalltRetrievecities

  • At value choose ‘id’, choose ‘Title’ for  the display name.

cities1

We have almost Done, just few steps are remaining here. 🙂 🙂

  • Click on the xPath button at the properties dialog of Room next to ‘Entries’.Click on the ‘Filter data’ button.

Xpath

FirstPopup

  • Click on ‘Add’.

Addfilter

1. In the first column, choose ‘select a field or group’.

Selectfieldgroup

2. A window pops up .Select the ‘main’ datasource, click on ‘dataFields’ and select ‘State’

main

3. In the second column, choose ‘equals to’.

4. In the third column, choose ‘select a field or group’. Again a window pops up,

thiredField

5. Select the ‘rooms’ datasource, click on ‘dataFields’ and select ‘State’.Click OK .

thirdfield1

thirdfinal

6. The filter will now look like ‘State equals State’. Now close all property dialogs.

filterconnection

  • Select the State column and click on ‘Add Rule’. Select the query action when the field is changed

Addrule

addrule1

  • Now choose the data connection ‘cities1′ and click OK.

ruledetails

  • Again, click State and make a new rule: When the field is being changed, set a value for a field.

setfieldvalue

  • Choose field ‘City’ and leave value empty.

roomdetails1

Finally! We are done. Fast publish the form to SharePoint again by pressing ctrl+shift+Q. Now if you carefully executed all steps above, you will see a form like this:

final

final1

Ting ting Titing  🙂 🙂 🙂

 

Advertisements

3 thoughts on “Cascading Drop Down List In SharePoint 2010

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s