0

I've a list where I've two drop downs, and I want to make the drop down list options in the second column dependent on the choice made in the first. So for example:

Column A is a drop down with options 1, 2, 3.

Column B is a drop down with options A, B, C, D, E, F.

Let's say I want some logic so that if the user selects 1 from Column A, they can only select A or B in Column B. If they select 2, they can only select C or D, etc.

What's the best way to design this? Is there appropriate syntax to accomplish this in the column validation field for Column B? Is this something that's easier done using InfoPath form controls?

Any help would be much appreciated!!!

  • If both column A & B are managed metadata (term set) will work. You can specify column B to only show the child terms based on the column A. Let me know if you want more details, I can upload a screenshot. – YogaPanda Dec 5 '17 at 22:12
3

The functionality you describe does not come with SharePoint out of the box, but it can be achieved with the free SPServices jQuery library created by SharePoint MVP Marc Anderson.

You will need to to learn a little bit about jQuery, how to make the jQuery and SPServices libraries available to your page, but all of that is included in the sample code.

The function you want is SPCascadeDropdowns and it is explained here.

It is also fairly easy to do with InfoPath. You need to

  • set up a data connection to the list
  • set the dropdown B value to that data connection, filtered by the value in dropdown A.

Example: four regions and hundreds of territories. Each territory has a field for region. The data connection to the Territories list has been established as a read connection.

Edit the choices for the Territory dropdown, set it to get choices from the data source "Territories", click the button next to "Entries", then click the "Filter Data" button and add a filter that the "Region" in the data source must be equal to the "Region" in the form's main data connection.

enter image description here

1

I know this question is old but for anyone trying to do this without external tools, you can use an xml document to build your data-set for column B with the related value of column A.

First you would add the choices to Column A as normal

enter image description here

Then, setup your xml document, add the data connection (receive data from xml), and set the choices for Column B to the data set with the filter on columnAValue.

enter image description here

After that, everything should be working correctly

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.