# Click a Button from a function

**URL:** <https://community.thunkable.com/t/click-a-button-from-a-function/2379658>\
**Category:** Questions about Thunkable X\
**Tags:** button, function\
**Created:** [April 19, 2023, 6:35am UTC](https://community.thunkable.com/t/click-a-button-from-a-function/2379658 "2023-04-19T06:35:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterjamesleniq](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@peterjamesleniq](https://community.thunkable.com/u/peterjamesleniq)\
**Post date:** [April 19, 2023, 6:35am UTC](https://community.thunkable.com/t/click-a-button-from-a-function/2379658/1 "2023-04-19T06:35:37Z")

</div>

Is there a component that allows you to click a button from a function.  
Meaning, if I call a function, is there a component that I can put into that function, that will click the button for me.

---

<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:** [April 19, 2023, 6:53am UTC](https://community.thunkable.com/t/click-a-button-from-a-function/2379658/2 "2023-04-19T06:53:38Z")

</div>

No, not if you physically want to click the button and see the click effect.

But if you just want the button’s code to run, then yes. You would create a function for the button’s code:

```auto
When button click
     function "do something"

```

And then when you want to “click the button”, you would just call that same function (“do something”).

I find that these kinds of questions are better with more information. Why are you needing to click a button from within a function?

---

<div class="post-metadata">

**Author:** ![peterjamesleniq](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@peterjamesleniq](https://community.thunkable.com/u/peterjamesleniq)\
**Post date:** [April 30, 2023, 6:33am UTC](https://community.thunkable.com/t/click-a-button-from-a-function/2379658/3 "2023-04-30T06:33:04Z")

</div>

Thanks.  
Doing that works perfectly.  
Thanks again.

---

<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:** [July 29, 2023, 6:33am UTC](https://community.thunkable.com/t/click-a-button-from-a-function/2379658/4 "2023-07-29T06:33:30Z")

</div>

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