# Trying to set a clickeable button that returns a random image of a set of four. Discards it and when clicked again it returns random one of the three remaining repeating until only one is left

**URL:** https://community.thunkable.com/t/trying-to-set-a-clickeable-button-that-returns-a-random-image-of-a-set-of-four-discards-it-and-when-clicked-again-it-returns-random-one-of-the-three-remaining-repeating-until-only-one-is-left/2987572
**Category:** Questions about Thunkable X
**Tags:** beginner
**Created:** [May 6, 2024, 12:23pm UTC](https://community.thunkable.com/t/trying-to-set-a-clickeable-button-that-returns-a-random-image-of-a-set-of-four-discards-it-and-when-clicked-again-it-returns-random-one-of-the-three-remaining-repeating-until-only-one-is-left/2987572 "2024-05-06T12:23:48Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![kuleff6uj53i](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@kuleff6uj53i](https://community.thunkable.com/u/kuleff6uj53i)
#### Post date: [May 6, 2024, 12:23pm UTC](https://community.thunkable.com/t/trying-to-set-a-clickeable-button-that-returns-a-random-image-of-a-set-of-four-discards-it-and-when-clicked-again-it-returns-random-one-of-the-three-remaining-repeating-until-only-one-is-left/2987572/1 "2024-05-06T12:23:48Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/1/a1a598648f99da6a36aacf6aed4d73bd2c3d58cb.png)  
I have come this far: (it randomly selects 1 of the 4 but I am missing the part in which I discard the selected one and choose with a new click from the remaining 3.

I will appreciate the help you can give me.

thank you in advance

hasta aqui he llegado :(me sellecciona al azar 1 de 4 pero me falta la parte en que descarte el seleccionado y elije con nuevo click de los 3 restantes .

apreciare la ayuda que podais brindarme

agradezco de antemano

---

<div class="post-metadata">

### Author: ![samir.henry3rz](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/samir.henry3rz/32/176572_2.png) [@samir.henry3rz](https://community.thunkable.com/u/samir.henry3rz)
#### Post date: [May 6, 2024, 1:49pm UTC](https://community.thunkable.com/t/trying-to-set-a-clickeable-button-that-returns-a-random-image-of-a-set-of-four-discards-it-and-when-clicked-again-it-returns-random-one-of-the-three-remaining-repeating-until-only-one-is-left/2987572/2 "2024-05-06T13:49:23Z")

</div>

> [@Random one data output](https://community.thunkable.com/t/random-one-data-output/1664364/16):
>
> THIS IS WHY YOU GET ALL OF THEM: if you read carefully, this block is taking ONE random item from a LIST (which has two slots - the first is a LIST of the answer thjnkable blah blah, the 2nd slot is unused) so the LIST really has only one item. now you’re taking one random item from a list containing one item so you will always get that item - but that item happens to contains a handful of values! that’s why you’re getting the results you describe. detach the list block with 2 slots from the …

> [@How to list functions and choose one at random?](https://community.thunkable.com/t/how-to-list-functions-and-choose-one-at-random/1584247):
>
> I would like to be able to add certain functions to a list and randomly call one of them Is there a more dynamic way of doing this than my example below?

I think these topics can help you.

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [May 6, 2024, 2:38pm UTC](https://community.thunkable.com/t/trying-to-set-a-clickeable-button-that-returns-a-random-image-of-a-set-of-four-discards-it-and-when-clicked-again-it-returns-random-one-of-the-three-remaining-repeating-until-only-one-is-left/2987572/3 "2024-05-06T14:38:24Z")

</div>

You’ll want to use the `Get and Remove` block in the List drawer: [Lists Blocks | Drag and Drop | Thunkable Docs](https://docs.thunkable.com/blocks/blocks/lists#get-get-and-remove-or-remove)

---

<div class="post-metadata">

### Author: ![kuleff6uj53i](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@kuleff6uj53i](https://community.thunkable.com/u/kuleff6uj53i)
#### Post date: [May 6, 2024, 5:24pm UTC](https://community.thunkable.com/t/trying-to-set-a-clickeable-button-that-returns-a-random-image-of-a-set-of-four-discards-it-and-when-clicked-again-it-returns-random-one-of-the-three-remaining-repeating-until-only-one-is-left/2987572/4 "2024-05-06T17:24:40Z")

</div>

cant make it work ☹ the idea is to get random items of the app variable name list and discard it so when the button Random Character is pressed again it selects one of the three remainings. Then from two and finally to show the last. This is done with this block.

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/d/7dcc05d9e61baec8154f214d501f7fd2d41a69f8.png)

But then i need to restart the sequence

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [May 6, 2024, 11:34pm UTC](https://community.thunkable.com/t/trying-to-set-a-clickeable-button-that-returns-a-random-image-of-a-set-of-four-discards-it-and-when-clicked-again-it-returns-random-one-of-the-three-remaining-repeating-until-only-one-is-left/2987572/5 "2024-05-06T23:34:40Z")

</div>

> [@kuleff6uj53i](#):
>
> cant make it work

Please be more detailed. It’s hard to know what part worked and what part did not.

> [@kuleff6uj53i](#):
>
> But then i need to restart the sequence

Then you need to set a different app variable (let’s call it backup) to app variable name in order to make a copy of the list. And then when the list is empty or the process needs to reset, set app variable name to the app variable backup and repeat the process.

---

<div class="post-metadata">

### Author: ![tiny\_apps](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@tiny\_apps](https://community.thunkable.com/u/tiny_apps)
#### Post date: [May 6, 2024, 11:46pm UTC](https://community.thunkable.com/t/trying-to-set-a-clickeable-button-that-returns-a-random-image-of-a-set-of-four-discards-it-and-when-clicked-again-it-returns-random-one-of-the-three-remaining-repeating-until-only-one-is-left/2987572/6 "2024-05-06T23:46:07Z")

</div>

Here is the logic…just adding to tatiang

Step 1…List of 4 images …  
Step 2. Make temp list copying original  
Step 3 Select and then remove one item you want. From temp list  
Step 4 Now temp list has 3 left …  
Step 5. Repeat step 2 through 5 until only 1 item left

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [August 4, 2024, 11:46pm UTC](https://community.thunkable.com/t/trying-to-set-a-clickeable-button-that-returns-a-random-image-of-a-set-of-four-discards-it-and-when-clicked-again-it-returns-random-one-of-the-three-remaining-repeating-until-only-one-is-left/2987572/7 "2024-08-04T23:46:20Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
