Dynamic Search | Dynamic number of fields, attributes, operations

Hi Mendix  TEAM,   we are using a Gallery Widget to show the data we want to implement  a Dynamic search bar(See Image from angular applicaiton) where the user can 1. Add or Delete  search filters 2. Select Attribute (among atleast 4 attributes) 3. Select Operation to be performed(=, !=, contains, starts with, ends with, null, is not null) 4. Case Sensitive/ insensitve search  ** Optional to have And/Or  condition on the filter → Is there a way this can be achieved else have to write 84 or so if conditions but feels like that will be a huge bulky process with a lots of complexity?
1 answers

Yes this could be done but is not an easy task. If you already now the entity it is easier then when the entity must also be chosen by the end user.

Entity unknown:

You could use the Mendix model reflection to choose the entity so that the user could choose the attribute it want to search on. Then based on the chosen attribute give him the filter possebilities like you have above. You might want to give different suggestions based on what sort of attribute it is. Then based on the selections use a microflow or OQL to retrieve those objects. Your only problem might be that for each different entity you would need a different microflow because since you need to return a list of objects based on the model reflection. And for microflows you can not dynamicly change the returned list.

Entity already known is easier because you already know which list to return.

Hope this helps a bit.