# One random image

**URL:** https://community.glideapps.com/t/one-random-image/11041
**Category:** Ask for Help
**Created:** [June 17, 2020, 5:22pm UTC](https://community.glideapps.com/t/one-random-image/11041 "2020-06-17T17:22:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Nicola\_Felaco](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicola_felaco/32/9151_2.png) [@Nicola\_Felaco](https://community.glideapps.com/u/Nicola_Felaco)
#### Post date: [June 17, 2020, 5:22pm UTC](https://community.glideapps.com/t/one-random-image/11041/1 "2020-06-17T17:22:44Z")

</div>

super noob question, but how can I set up to pick one random image from a column?

---

<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: [June 18, 2020, 12:44am UTC](https://community.glideapps.com/t/one-random-image/11041/2 "2020-06-18T00:44:03Z")

</div>

Hi Nicola, welcome to the community.

No, I don’t think this is a noob question at all. There are several ways you can achieve this, I’m gonna give you one way to do it.

So you have an “Image” column with all the URLs. Create one new column, I assume you want to display it in an image component, let’s call that “Featured”. In the only cell of the featured column put the following formula, assuming you store the images in column A.

```
=index(A2:A,randbetween(1,counta(A2:A)))

```

This formula will grab all the rows containing images from cell A2 to the last cell containing data in column A, then randomly pick an index integer, which returns the URL of image in question via the INDEX formula.

---

<div class="post-metadata">

### Author: ![Nicola\_Felaco](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicola_felaco/32/9151_2.png) [@Nicola\_Felaco](https://community.glideapps.com/u/Nicola_Felaco)
#### Post date: [June 18, 2020, 11:31am UTC](https://community.glideapps.com/t/one-random-image/11041/3 "2020-06-18T11:31:29Z")

</div>

That’s awesome! Thank you!  
Does this formula refresh every time I load/open the app?

---

<div class="post-metadata">

### Author: ![Ofer\_Chama](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ofer_chama/32/9007_2.png) [@Ofer\_Chama](https://community.glideapps.com/u/Ofer_Chama)
#### Post date: [June 18, 2020, 3:00pm UTC](https://community.glideapps.com/t/one-random-image/11041/4 "2020-06-18T15:00:10Z")

</div>

You can determine when it refreshes by going to Spreadsheet Settings-\>calculate and choose whether you want it to refresh on change only, on change and every hour or on change and every minute

---

<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: [June 19, 2020, 2:07am UTC](https://community.glideapps.com/t/one-random-image/11041/5 "2020-06-19T02:07:10Z")

</div>

Can you try Ofer’s way above and see if it works?

---

<div class="post-metadata">

### Author: ![Nicola\_Felaco](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicola_felaco/32/9151_2.png) [@Nicola\_Felaco](https://community.glideapps.com/u/Nicola_Felaco)
#### Post date: [June 20, 2020, 6:59am UTC](https://community.glideapps.com/t/one-random-image/11041/6 "2020-06-20T06:59:10Z")

</div>

Yeah it works!!! Thank you!
