# Simple random item from data

**URL:** <https://community.glideapps.com/t/simple-random-item-from-data/72194>\
**Category:** Ask for Help\
**Created:** [March 31, 2024, 12:59pm UTC](https://community.glideapps.com/t/simple-random-item-from-data/72194 "2024-03-31T12:59:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luckyg](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luckyg/32/73032_2.png) [@luckyg](https://community.glideapps.com/u/luckyg)\
**Post date:** [March 31, 2024, 12:59pm UTC](https://community.glideapps.com/t/simple-random-item-from-data/72194/1 "2024-03-31T12:59:55Z")

</div>

hello community, I am totally new here and with zero coding experience, so please forgive my silly questions.  
I have a data list. When the user click on a button I want 1 random item from my data list to show.  
That’s it. I just can’t get my head round on how to do this. Please help 🙏

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [March 31, 2024, 7:58pm UTC](https://community.glideapps.com/t/simple-random-item-from-data/72194/2 "2024-03-31T19:58:28Z")

</div>

Hello LuckyG, welcome to Glide and the community forum.

In the data editor: create a table with your list of items. You’ve probably already done this.

In the layout editor:

- Create a new tab and add a collection component to it whose data source is the table with the list. You should see the list of items.
- Select the collection component by clicking on it. On the right hand side, you can configure this collection.
- In the general tab, at the bottom in the options area, limit the number of items to be displayed to 1.
- In the options tab directly right of the general tab, set the sort setting to random.
- If you want to control when the list shuffles, add a button component to the screen, for instance above the collection. and associate the action called “Data → Shuffle” to the button. Each click of the button will shuffle the collection.

There you go. Now every time the page is reloaded or the button is clicked, the collection will display a single element at random.
