Mar 162012
 

This is one in a series of posts on using InfoPath. If you are new to SharePoint lists and InfoPath you might want to start with the Best Practices.

Best Practices for Cascading SharePoint Lists using InfoPath Forms

Use a SQL Server data source for an InfoPath pick list

Continuing with the same example I used in the Best Practices post, I’m going to make a change to an existing InfoPath form.  Navigate to the SharePoint list called Supply Chain Scorecard Metrics and add a new item. In the Section drop down, notice that I’ve included the Goal as part of the Section description (Goals are Improve, Maintain and Track). 

image

What I could do is have the user choose the goal, and then filter the Section list to show only those Sections which have that Goal.  Here’s how we can do that.

ADD THE GOAL TO YOUR LIST

Navigate to your Supply Chain Scorecard Metrics list and in the List menu click on the List Settings.  Add a column called Goal_ID with type of Number.  Require that the column contains information.  When the user selects a Goal we will store the Goal ID in the Metrics list, and then use that to filter the drop down list of available Sections the user can choose from.

image

ADD THE GOAL TO YOUR FORM

Navigate to your Supply Chain Scorecard Metrics list and in the List menu click on the Customize Form button to open up the InfoPath form.

image

Click OK and enter a password if necessary.  Click Yes when it asks if you want to update the fields from the SharePoint list.

Add a row to your InfoPath form above Section by highlighting the Section row, right click and select Insert –> Rows Above. 

image

From the Fields window, drag the Goal_ID field into the right hand cell in the row you just created.

image

Delete the label that says Goal_ID:, and type in Goal in the cell to the left of the Goal_ID textbox.

image

Right click on the Goal_ID text box and select Change Control –> Drop-Down List Box

image

Right click again and select Drop-Down List Box Properties.

image

Select Get choices from an external data source and then from the data source drop-down choose Supply Chain Scorecard Section.

image

Set Value = Goal_ID and Display name = Goal.  Check the box that says Show only entries with unique display names.  Click OK.

image

FILTER THE SECTION CHOICES BY THE GOAL SELECTED

Right click on the Section drop down list box and select Drop-Down List Box Properties.Beside the Entries box, click on the tree icon.

image

Click on the Filter Data button.

image

Click on the Add button.

image

Now we will specify on what to filter the Section list.  In the first drop down select Goal ID. Leave the second drop down as “is equal to”.  In the third drop down select “Select a field or group”

image

Change the data connection in the drop down to Main. Navigate to dataFields and then to Goal_ID.

image

Click all of the OK buttons. Publish your InfoPath form.

Add a new item.  Select Improve as your Goal.  Notice that the Section drop down has only those Sections that have a Goal of Improve.

image

And that is how you filter a drop down from another value in your list.

  7 Responses to “Dynamically filter a Drop Down on your SharePoint list by another User Selected Value”

  1. It worked but I want to create multiple cascading list based off of this one selection i.e. if I select a project that was entered in I should be able to select the project manager, project start date, project description etc. Based on the project selected.

    Please let me know if this is possible.

    Thanks,

    • Yes, that is possible. In the section of the post labeled FILTER THE SECTION CHOICES BY THE GOAL SELECTED, you can use the same filter (in your case maybe ProjectID) for each of the other data sources you are using for project manager, project start date, etc.

      Cheers,
      Martina

  2. can we apply this using designer. since my requirements is to do with only in sharepoint designer.
    i want to use filter like, we have to filter data from the another list, we have to show the drop down list to choose the value dynamically for each field, and we should retrive the matched list items in another list to show the result in the view, how can i acheive this. please help me.

  3. hi.. I am new in sharepoint and we only have ms InfoPath. I have 3 dropdown list which is interconnected to each other.
    Category Type (RAWMAT, LIQUID, PACK)
    Category
    Basket

    Let’s say I selected RAWMAT, only category under RAWMAT should show in the category dropdown and whatever I select in Category only baskets on that particular category should show in the basket dropdown. Is it possible? please help.

    I am trying to follow this but I am having a hard time as the criteria is different.

    thanks a bunch.

  4. After checking out a handful of the blog posts on your
    site, I honestly appreciate your technique of writing a blog.
    I book-marked it to my bookmark site list and will be checking back in the near future.
    Take a look at my website too and tell me what
    you think.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

Wordpress SEO Plugin by SEOPressor