# How to highlight the selected item at list?

**URL:** <https://community.glideapps.com/t/how-to-highlight-the-selected-item-at-list/78078>\
**Category:** Ask for Help\
**Created:** [November 21, 2024, 2:52am UTC](https://community.glideapps.com/t/how-to-highlight-the-selected-item-at-list/78078 "2024-11-21T02:52:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![primechome](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@primechome](https://community.glideapps.com/u/primechome)\
**Post date:** [November 21, 2024, 2:52am UTC](https://community.glideapps.com/t/how-to-highlight-the-selected-item-at-list/78078/1 "2024-11-21T02:52:48Z")

</div>

Hi,

My app shows list of items at List style collection. When I click on one of the items at list, the app will display detail screen for this item. When I click back to list of items screen, how to highlight the item that I click before?

Please assist. Thank you.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [November 21, 2024, 3:25am UTC](https://community.glideapps.com/t/how-to-highlight-the-selected-item-at-list/78078/2 "2024-11-21T03:25:25Z")

</div>

You’d need to add an action step to save the rowID of the item you clicked to another column (perhaps in the user table) using a set column action. Then, style the line with an icon or color or perhaps CSS if the record ID matches what was saved.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [November 22, 2024, 12:32am UTC](https://community.glideapps.com/t/how-to-highlight-the-selected-item-at-list/78078/3 "2024-11-22T00:32:37Z")

</div>

> **[CSS Library](https://css-library.glide.page/dl/library/s/8836b3/r/cHWeka3sTnCGRzWzqz7g5A)**

You can use Robert’s idea with a variation of this CSS method. You may use the custom collection layout.

- Set the rowID of the selected item to a user’s table column.
- Add a component to the custom component level.
- Set a class name for the component (e.g., “highlight-item”).
- Set the component’s visibility condition to be only visible when item’s rowID matches the “viewing rowID”.
- Apply CSS styling from the provided link to create the highlight effect.

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [November 22, 2024, 3:29am UTC](https://community.glideapps.com/t/how-to-highlight-the-selected-item-at-list/78078/4 "2024-11-22T03:29:30Z")

</div>

Or, you can use a custom AI Component to trigger an action on screen mounted :

> [@Auto Action trigger](https://community.glideapps.com/t/auto-action-trigger/77525):
>
> I made a prompt that allow an action to be triggered on page load. I attempted to create a prompt that allows the AI component to perform an action on load after a delay of 100 ms. While I couldn’t get it to work with the provided delay value, it still enables us to make the AI execute a custom action upon page load. Here is the prompt : 1. In the \*\*DATA\*\* section, define only the `Delay` property with a milliseconds value. 2. On component load, automatically retrieve the `Delay` property. If…

You can make the AI prompt simple. I actually were able to simplify my prompt even more. Just ask to run an action on component mount after x ms.

---

<div class="post-metadata">

**Author:** ![primechome](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@primechome](https://community.glideapps.com/u/primechome)\
**Post date:** [November 22, 2024, 7:04am UTC](https://community.glideapps.com/t/how-to-highlight-the-selected-item-at-list/78078/5 "2024-11-22T07:04:28Z")

</div>

I managed to resolve the issue with yours given solutions.

Thank you all. 🙂
