Recently, there was a widget added to the app store called Grid Search, which does just what you want. One search box for a datagrid that searches across multiple attributes.
You could use a listview. It has a single search field where you can add several attributes to search on. If you want to use a datagrid, do the following:
- Download the app store widget Search input widget.
- Create an object (helper) with attribute search (string), show this object in a dataview. You could have a datasource microflow to create this object.
- Use a microflow connected to the widget to filter your objects based on your input. So your retrieve all your objects where the search input matches the value of your objects attributes that you define.
- Associate the search results to your object helper.
- Show the datagrid with an association to the dataview object. (Your current object).
I hope this helps.
Robert gives a great answer. I would like to suggest a more dirty apporach, but depending on your scenario might do the trick.
Create a string attribute e.g. "SearchString" and set it in a before commit event like so
$SearchString = $Adress+' '+$Phone+' '+$Email ....
You should not show this attribute in the grid. instead only use in the search field.
Hope this helps,
PS: This will store each field that you want to search by one additional time.
PSS: here is the BCo microflow https://modelshare.mendix.com/models/9c28c589-3c3f-4c71-b2a0-c53c1870fd9c/bco-contact-search-on-multiple-fields
Another more advanced suggestion would be to implement a lucene text search integration. That way you can use wildcards, search in referenced records etc in one go.