# How to repeat processes?

**URL:** <https://community.thunkable.com/t/how-to-repeat-processes/2607599>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, help\
**Created:** [September 22, 2023, 12:31am UTC](https://community.thunkable.com/t/how-to-repeat-processes/2607599 "2023-09-22T00:31:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![klugpufff](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/klugpufff/32/161506_2.png) [@klugpufff](https://community.thunkable.com/u/klugpufff)\
**Post date:** [September 22, 2023, 12:31am UTC](https://community.thunkable.com/t/how-to-repeat-processes/2607599/1 "2023-09-22T00:31:23Z")

</div>

Hi!

I set the programming on what should happen when a screen opens, but I want to include a button that when the person clicks it it repeats the process (the app will have sorted a movie from a movie list and if the person clicks it it should choose another one). I tried some things like changing the variable by 1 and it didn’t work, does anyone know how to do that?

 ![screen1-2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/0/5064b4d614cb60ee466e5897fe9642ea5f0b5004.png)

---

<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:** [September 22, 2023, 12:41am UTC](https://community.thunkable.com/t/how-to-repeat-processes/2607599/2 "2023-09-22T00:41:00Z")

</div>

Give some examples of what you mean with sample data.

---

<div class="post-metadata">

**Author:** ![klugpufff](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/klugpufff/32/161506_2.png) [@klugpufff](https://community.thunkable.com/u/klugpufff)\
**Post date:** [September 22, 2023, 12:53am UTC](https://community.thunkable.com/t/how-to-repeat-processes/2607599/3 "2023-09-22T00:53:34Z")

</div>

So, what I mean is that I want everything above the “click” to happen again, I don’t know how I would add data to exemplify that. If I could, I’d put the two yellow blocks above inside this when click. So if the person clicks on that button, it will repeat that process (selecting a random item and extracting the image and text in that row in the data source). I’m really sorry I can’t even explain myself.

---

<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:** [September 22, 2023, 1:32am UTC](https://community.thunkable.com/t/how-to-repeat-processes/2607599/4 "2023-09-22T01:32:28Z")

</div>

So you’re just wanting the app to choose a random row of your database and display several columns’ values from that row?

---

<div class="post-metadata">

**Author:** ![klugpufff](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/klugpufff/32/161506_2.png) [@klugpufff](https://community.thunkable.com/u/klugpufff)\
**Post date:** [September 22, 2023, 1:51am UTC](https://community.thunkable.com/t/how-to-repeat-processes/2607599/5 "2023-09-22T01:51:25Z")

</div>

Sort of. I mean, yes, but this part I got covered, the programming for that works. (the one on the print above)

Now, I want to create a button that initiates this sequence of actions again. Right now, the app makes a random choice whenever the screen opens and I want to build a “choose again” button so the app makes another random choice whenever a person clicks on said button.

---

<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:** [September 22, 2023, 4:10am UTC](https://community.thunkable.com/t/how-to-repeat-processes/2607599/6 "2023-09-22T04:10:56Z")

</div>

You can put the blocks you want to re-use into a [function](https://docs.thunkable.com/blocks/blocks/functions) block and give it a name. Then, when you want to repeat those blocks, just use the named function block.

---

<div class="post-metadata">

**Author:** ![klugpufff](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/klugpufff/32/161506_2.png) [@klugpufff](https://community.thunkable.com/u/klugpufff)\
**Post date:** [September 22, 2023, 8:38pm UTC](https://community.thunkable.com/t/how-to-repeat-processes/2607599/7 "2023-09-22T20:38:26Z")

</div>

Thanks! It worked!

---

<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:** [December 21, 2023, 8:38pm UTC](https://community.thunkable.com/t/how-to-repeat-processes/2607599/8 "2023-12-21T20:38:38Z")

</div>

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