Record Search Box in GridField - Searching Names (First and Last)

A Score Level 2

As far as I know, the record search box on a record-backed gridField will do a search on the raw data of all of the columns in the grid. For example, searching for "username1" will return any rows that contain "username1" in any of the columns' raw data, regardless of how the data is formatted. If the column data was formatted to show First Name or Last Name, a search for "username1" would still return the row; however a search for the First Name value or Last Name value would not return any results, as this is a formatted value and not the raw value.

I have a requirement for the search box to enable searching on first name and last name values, not only username. Are there any elegant solutions to enable this?

The only ideas I have are not very elegant:

  1. create a daily username sync process so the database has the user's first and last names, then update the view / cdt to include these values.
  2. convert the record to an expression backed record and construct the datasubset with the first name and last name values

  Discussion posts and replies are publicly visible

Parents Reply Children