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

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
  • Using custom fields on a record type you can create separate fields for first name and last name. This removes the need to update a view or CDT.

  • 0
    A Score Level 2
    in reply to Danny Verb

    This does not solve this issue. This issue is that the Appian record search does not return matches on formatted values (i.e. values generated by passing the data into an expression). In your proposed solution, the username value will be formatted to first and last name display values, using the user() function. The native search only searches on the raw data, in this case, the username. So even though the column displays "Wen" for first name, the data that backs that column is a username "whuynh", so searching "Wen" won't return this row. A search for "whuynh" will return the row. Does that make sense?

Reply
  • 0
    A Score Level 2
    in reply to Danny Verb

    This does not solve this issue. This issue is that the Appian record search does not return matches on formatted values (i.e. values generated by passing the data into an expression). In your proposed solution, the username value will be formatted to first and last name display values, using the user() function. The native search only searches on the raw data, in this case, the username. So even though the column displays "Wen" for first name, the data that backs that column is a username "whuynh", so searching "Wen" won't return this row. A search for "whuynh" will return the row. Does that make sense?

Children