Jump to content

How to limit Property Control - drop down list to show only unique values that are not filtered out from a column of a datatable.


achen1
Go to solution Solved by David Boot-Olazabal,

Recommended Posts

At the moment I have this dropdown list that shows ALL unique values from the 'process_attribute' column of a datatable as selectable options. 

I can't figure out how to make my dropdown list ONLY SHOW the values that have not been filtered out. So I need my dropdown list to dynamically change based on the filters I apply to the datatable.

Example: This is my starting datatable with no filters

process_attribute
A
B
C

Let's say I apply a filter to my datatable so that Im only left with A and B (row C was eliminated based on my filters). My dropdown list should only propose values A and B. Currently its still proposing value C even though 'C' has been filtered out already.

I can't find a way to do this, someone has an idea?

Link to comment
Share on other sites

I don't know how to do that based on filters, but I have done this with multiple dropdowns. You can use one dropdown to select unique values of "Group1".  Then, you can use a calculated variable to say: case when Group1 = DocumentProperty("Grp1") then Group2 end.  Then, you can add a second dropdown called Grp2 that shows the unique values of Group2.  Obviously, this gets complicated when multiple fields are being filtered on though.  

Link to comment
Share on other sites

1 hour ago, Steve Phillips 3 said:

I don't know how to do that based on filters, but I have done this with multiple dropdowns. You can use one dropdown to select unique values of "Group1".  Then, you can use a calculated variable to say: case when Group1 = DocumentProperty("Grp1") then Group2 end.  Then, you can add a second dropdown called Grp2 that shows the unique values of Group2.  Obviously, this gets complicated when multiple fields are being filtered on though.  

How/ where do I create the calculated variable: "case when Group1 = DocumentProperty("Grp1") then Group2 end"

Does this variable get applied to the "limit data using expression" part of the datatable? 

Link to comment
Share on other sites

Hi @achen1

You'll have to create a calculated column with the filtered values, and use that one for your combobox.

You'll need some scripting, both IronPython and Javascript.

I made a quick example for you :)  you have a Region List that filters the Country Name Combobox.

If you have any questions please let me know!

filtered Combobox.dxp

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...