This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SUPPORT Q&A - Form Field Dropdown Values Based on Two or More Filtered Values

AMF - Wednesday, May 28, 2014 7:33 PM:

I've gotten one field in a form to filter values based on the input of another field in the same form.  However, I can't seem to get one field to be filtered based on the inputs of two or more fields.  Below is an example of what I would like to do.

Form Example:

Category (dropdown)

  • Plate
  • Pipe
  • Bolt
  • Nut

Code Standard (dropdown)

  • ASTM
  • ANSI
  • ASME
  • ISO
  • GB/T

Material Specification (dropdown)

  • A307
  • A325
  • 898-1
  • A36
  • Q235B
  • A106B

Selection of Plate and ASTM gives A36 as the only option in the material specification dropdown since Q235B is a GB/T standard.

Selection of Bolt and ISO gives 898-1 as the only option.  If ASTM were selected, A307 and A325 would be the only options.

I added 'filter2' to the 'Filter Value' ItemType so 'Filter2' no appears alongside 'Filter' when creating a list (see screenshot).

I also added 'Pattern2' to the 'Properties' ItemType.  However, 'Pattern' has a dropdown of values that can be selected.  'Patter2' does not have a dropdown of values, thus, I don't think it's linking up.

If this is possible, I may have more than two filters in the future to allow the user to drill down easily into a lot of options.



Brian - Monday, June 2, 2014 12:19 AM:

Hi AMF,

What you are trying is not possible out of the box, as you already figured out. However, just adding a second filter to the list is not going to fix it either. There is code in the background that deal with filtered lists and it expects to only see one filter item.

If you only have two filters to work on you could create a second filtered list which is hidden on the form and have the onChange of the first list set the value of the second list. Then it would appear as if both of the end result lists are being triggered from the one initial selection.

This is probably the easiest way of achieving your outcome.

With a bit of work you could do this but you would need to do all the filtered list handling yourself and probably not use the filtered list that comes out of the box. I think you would create your own "Special List" item type with "labels" and "values" and related "filters" (another item type). This way you could have as many filters for each list value as you liked. You populate a number of primary dropdowns with your own code and respond to the onChange. So you end up with maybe three dropdowns that all allow you to select one series of filters each. You respond to each selection by retrieving all of the filtered list values that fit all of the selected filter items and display the resulting items.

I'm not sure if this meets your requirements of not. I may have just confused myself writing this out!

Cheers,

Brian.