# How to mimic a button?

**URL:** https://community.thunkable.com/t/how-to-mimic-a-button/2485662
**Category:** Questions about Thunkable X
**Tags:** button, help
**Created:** [June 28, 2023, 3:54am UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662 "2023-06-28T03:54:50Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![mikediaz](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mikediaz/32/155764_2.png) [@mikediaz](https://community.thunkable.com/u/mikediaz)
#### Post date: [June 28, 2023, 3:54am UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/1 "2023-06-28T03:54:50Z")

</div>

This is probably simple, but I cannot figure this one out. I’ve been working days and long hours on this app and I am stumped trying to figure out how to mimic a button. For example: on one screen I have a create button which loads a layout. On that layout I have created another button to mimic the response of the create button. I cannot figure out how to tie these two together.

---

<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: [June 28, 2023, 5:36am UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/2 "2023-06-28T05:36:02Z")

</div>

I don’t understand. The create button loads a layout, presumably by creating or cloning components, correct? And if you need another create button why not just use an actual button? Why do you need to mimic a button? Are you asking how to call a set of blocks (aka a function) from a different screen?

---

<div class="post-metadata">

### Author: ![mikediaz](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mikediaz/32/155764_2.png) [@mikediaz](https://community.thunkable.com/u/mikediaz)
#### Post date: [June 28, 2023, 1:22pm UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/3 "2023-06-28T13:22:11Z")

</div>

Yes so basically when create button is clicked it opens a layout which acts as a second screen and covers the main page. I then added a regenerate button , which will need to mimic the create button to generate another image.

---

<div class="post-metadata">

### Author: ![mikediaz](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mikediaz/32/155764_2.png) [@mikediaz](https://community.thunkable.com/u/mikediaz)
#### Post date: [June 28, 2023, 1:52pm UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/4 "2023-06-28T13:52:37Z")

</div>

Here’s a video to help explain a little better.

> **[IMG\_6153.MOV](https://drive.google.com/file/d/1ceJGRqnfZ7TajzlYww4kSWkn5jDIzWae/view?usp=sharing)**
>
> Google Drive file.

---

<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: [June 28, 2023, 1:56pm UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/5 "2023-06-28T13:56:15Z")

</div>

Does the create button **show** a Layout component? Because you can’t **open** a Layout component in Thunkable.

Why are you wanting to create an image? Wouldn’t the Create button always show a Layout? Why would it create/show an image?

I still feel like there’s a lot you’re not explaining. Do you have an example of this from another app/video/etc.?

Can you share a link to your project? It might make more sense to me if I can see your set up.

---

<div class="post-metadata">

### Author: ![mikediaz](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mikediaz/32/155764_2.png) [@mikediaz](https://community.thunkable.com/u/mikediaz)
#### Post date: [June 28, 2023, 2:07pm UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/6 "2023-06-28T14:07:40Z")

</div>

Removed Link\*

Okay so go to stable diffusion, type anything in the prompt then hit the create button. You’ll see how I have a layer that pops up over the screen which will have a few buttons on the bottom. The generate button is the one I need to mimic the create button to regenerate the image.

---

<div class="post-metadata">

### Author: ![mikediaz](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mikediaz/32/155764_2.png) [@mikediaz](https://community.thunkable.com/u/mikediaz)
#### Post date: [June 28, 2023, 3:30pm UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/7 "2023-06-28T15:30:08Z")

</div>

Crap I thought with the app being private, you wouldn’t be able to see the code blocks.

---

<div class="post-metadata">

### Author: ![mikediaz](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mikediaz/32/155764_2.png) [@mikediaz](https://community.thunkable.com/u/mikediaz)
#### Post date: [June 28, 2023, 9:46pm UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/8 "2023-06-28T21:46:04Z")

</div>

Any thoughts?

---

<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: [June 29, 2023, 1:21am UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/9 "2023-06-29T01:21:34Z")

</div>

If you want to share the link via private message, you can. Otherwise, I guess I’d need screenshots to understand this fully.

I asked about a function and it sounds like that’s what you’re describing. In other words, you have a set of blocks that trigger when you click the Create button. And then you want a different button in your overlayed layout that does the same thing as the Create button? If so, are those two buttons on different Thunkable screens or the same screen?

---

<div class="post-metadata">

### Author: ![mikediaz](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mikediaz/32/155764_2.png) [@mikediaz](https://community.thunkable.com/u/mikediaz)
#### Post date: [June 29, 2023, 1:56am UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/10 "2023-06-29T01:56:21Z")

</div>

That’s exactly what I am trying to do. Yes both buttons are on the same screen.

---

<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: [June 29, 2023, 2:39am UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/12 "2023-06-29T02:39:07Z")

</div>

Okay… so just create a function with the blocks you want for the Create button to trigger. And then in your second (“mimic”) button, call the function again.

See [Functions - Thunkable Docs](https://docs.thunkable.com/functions)

---

<div class="post-metadata">

### Author: ![mikediaz](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mikediaz/32/155764_2.png) [@mikediaz](https://community.thunkable.com/u/mikediaz)
#### Post date: [June 29, 2023, 3:16pm UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/13 "2023-06-29T15:16:32Z")

</div>

Good Morning,

This would be my first time creating a function, I’ve tried multiple ways to see if I could get that trigger function to work but I’m pretty much lost at this point lol.

 ![Screenshot 2023-06-29 111525](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/6/9629cd5aa369c241f33817fbef315ba17a158cce.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: [June 30, 2023, 3:52am UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/14 "2023-06-30T03:52:05Z")

</div>

You said that you have blocks for a Create button that loads a layout. When you post a screenshot, you should be posting those blocks.

But then, move those blocks into a function. The default name for a function is “do something” but you should rename that. So your function could be called something like “Create layout”. Do not use the “do something and return block” which returns a value from the function. Just use the standard “do something” function block.

Then call the “Create layout” button from your “When Button Create Click” event block and see if that works as you expect it to.

---

<div class="post-metadata">

### Author: ![mikediaz](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mikediaz/32/155764_2.png) [@mikediaz](https://community.thunkable.com/u/mikediaz)
#### Post date: [June 30, 2023, 4:32am UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/16 "2023-06-30T04:32:39Z")

</div>

Ughh I got it. I’m so mad at how easy that was! Thanks again your a great help!

---

<div class="post-metadata">

### Author: ![mikediaz](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mikediaz/32/155764_2.png) [@mikediaz](https://community.thunkable.com/u/mikediaz)
#### Post date: [June 30, 2023, 4:34am UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/17 "2023-06-30T04:34:03Z")

</div>

Can you do the same for another screen or just items on the same screen?

---

<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: [June 30, 2023, 5:40am UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/18 "2023-06-30T05:40:08Z")

</div>

Unfortunately, functions are not “global” so they are limited to a single screen. Thunkable needs to be a little more flexible and that’s one way it could be improved. That feature request has been made in the past but it wouldn’t hurt to make it again at [Feature Requests - Community](https://community.thunkable.com/c/thunkable/feature-requests/84)

There are some suggestions for workarounds here: [Creating a function usable across screens](https://community.thunkable.com/t/creating-a-function-usable-across-screens/1765645)

---

<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: [September 28, 2023, 5:40am UTC](https://community.thunkable.com/t/how-to-mimic-a-button/2485662/19 "2023-09-28T05:40:26Z")

</div>

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