Highlighting search results in a repeating group

I have an input box into which a user types a name (or part of one).
Their input is used in a search and matching records appear underneath in a repeating group.
When the search is completed and results are displayed, the Search box disappears.
When one of the search results is selected, I want it to highlight only the selected record but all I can get it to do is highlight all records in the table.

Here’s a shot of what’s happening - (I know it’s ugly)

Screenshot 2023-05-09 143944

If The Grand Hotel in Stockholm is selected, I want only that record to highlight.
I feel this is easy but, well, it was a long weekend and I can’t figure it out.

Also, is there an accepted method of highlighting a selected item such as background colour/dimmed or highlighted text/something else?

I’d be so grateful for any suggestions.
All the best

Hi there, @joefarrowsmith… one way you could go is to set a custom state to the current cell’s index when a record is highlighted. Then, use conditions on the elements in the repeating group (or on a group that contains the elements) to highlight them (whatever that means to you) when the custom state’s value is the current cell’s index.

Hope this helps.


1 Like

Excellent. Thanks Mike. I haven’t done much with the “Index” number in the past so you’ve saved me a lot of digging there and it works exactly as I wanted. You’re a star!

1 Like