How to apply multiple filters on DataGrid

2
Hi, I am working on a filter feature and so far it seems i am not able to apply more than one filter to the search results. What i want to achieve: i have two imput parameters in my microflow: SearchResults and SearchFilters. and i want to implement this pseudo-code logic: if SearchFilter.filter1 != empty then use action filter list based on filter1 on SearchResults and update the SearchResults list if SearchFilter.filter2 != empty then use action filter list based on filter2 on SearchResults and update the SearchResults list if SearchFilter.filter3 != empty then use action filter list based on filter3 on SearchResults and update the SearchResults list the above should be executed in that order. how can i achieve this? can i update directly the imput parameter SearchResults and return it after all filtering is done? EDIT: to explain better, i want to implement this logic: if attribute is not empty, filter based on attribute, else go to the next filter action and don't do anything with the current one. is it possible in mendix?
asked
3 answers
1

The way you've written it would perform filtering in memory. Here's a microflow that accomplishes this almost exactly like your psuedo-code:

https://modelshare.mendix.com/models/5ba106c1-80e9-4bf0-8d68-65e5660d5354/three-field-filter

 

Depending on your data, it may make more sense to do this in one or more database (XPath) retrieves. That would look something like this (I think this will work but haven't tested it):

https://modelshare.mendix.com/models/57697f30-f65a-487c-8cfa-743ea6a05474/database-xpath-searching

 

answered
0

You can use a microflow as datasource of a grid and perform your logic. Alternative is a helper object with a reference set to your selected data. Fill that reference set in a microflow.

answered
0

Cristian,

Could you please put a couple of screenshots up for us?

Thanks!

answered