Create the non-persistable entity called ‘Filter’ (for example)
Give the entity the attributes you want to filter on with the corresponding data type: description would be a string; type could be an enumeration …
On the page where you want to display the data, add a filter header by passing a newly created filter object to a the page. You might need to create a nanoflow/microflow to navigate to this page now, instead of using the show page option if you are doing this.
Place a data view widget on the page and put some input widgets in the data view for the items you want to filter on as such:
Create a nanoflow which has an input parameter of the filter and a refresh object action as such:
Add this nanoflow as an on change event for all the input widgets you have placed within the data view
Important: from now onwards we are going to work in the microflow you have shown us
In your microflow, add a parameter of your filter object
After you have executed the query, you are going to add a list operation action, where you filter by expression. Here you have to determine your searching/filtering criteria. Therefore this step is very important! If you have multiple filtering criteria, you might have to add this action a couple of times for each criterium and do other list operations to merge the results (such as an intersect)
Finally sort the list based on an attribute using the list operation > sort functionality in another action for cleaner results. It might look something like this if you replace the retrieve action by your database query (for two filter criteria):
Let me know if you have additional questions or remarks. I tried to be as descriptive as possible, whilst still staying quite brief.
Juriaan Van Kerckhove
There is an easier workaround and it may work in some cases you’re retrieving data from a microflow and need to implement searching capabilities from a Data grid.
We can do this by creating additional context for the Data grid using a Data view widget with Data source from the microflow, retrieving an object so we can constraint the data from the data grid.
Instead of retrieving all data from the microflow, we should retrieve and object we use to make the final constraint later on.
Then, on the page put a Data view with Data source from the microflow above. Inside, use the Data grid with Data source XPath, finally you create the final constraint to get your data, using the token '[%CurrentObject%]' to do so.
So, basically, we split the process of retrieving the data from a microflow to do the final activity on the page and not the microflow.
you can use data grid 2 and add column filters to it.