Dynamically populated dropdown filter

Hello, I am looking for a solution to a problematic I have been facing in my current project; I am currently working with a listview displaying data using a Xpath request and various list controls to look through and filter demands imputed by the user. However, one of the filter needs to be dynamically populated with every manager that can accept request to allow them to see who is working on what demand. I am unsure on where to start to make a dynamic dropdown filter, alternatively I am thinking a search bar would be more appropriate but before presenting this option I wanted to make sure that there are no alternatives that would get me closer to the expected result.
2 answers

Hi Quentin,


I ran into the same requirement a couple of times and if I understood you correctly, I think you can achieve that by using a “search helper” entity (non-persistent) which has an association to the entity you want to filter for. 


I have put something together to show it real quick:


So let’s say the listviews entity is ItemA and has an association to entity ItemB (in your case the manager).

You put a dataview with datasource microflow for the SearchHelper entity on the page where you need the filterable listview. In that microflow you set the “All” association to all the objects you want to be shown on the page. You do the same for the “Filtered” association (except if you want the data to be pre-filtered).


[I have two associations from the search helper. In that way you don’t have to retrieve from database everytime a filter changes. Instead you can just filter the associated list (All).]


Inside the dataview you put a listview with source association and select the “Filtered” association of the SearchHelper. Now you can put a dropdown selector for the SearchHelper association to ItemB which auto-populates and you can even constrain the selectable objects further. On-change of the dropdown you have to filter the objects (“All”) according to the selection and change the SearchHelper “filtered” association accordingly (with a refresh in client) so that the list get’s updated and shows the filtered list of objects.


Please be aware that this solution has limitations for big amounts of data but in most cases so far this worked for me. You also have to make sure that the logic for the on-change events of the SearchHelper attributes/associations is set up properly (e.g., if you want combined filtering for a specific attribute and the dropdown selection).


I hope I described everything understandable. Please let me know if you need more information!







The Grid Search widget allows for more advanced dynamic filtering:



Hope that helps,