How to repeat processes?

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?

Give some examples of what you mean with sample data.

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.

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

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.

You can put the blocks you want to re-use into a function block and give it a name. Then, when you want to repeat those blocks, just use the named function block.

Thanks! It worked!

1 Like

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