# \[Solved\] Can i call function of Screen1 in Screen2?

**URL:** <https://community.thunkable.com/t/solved-can-i-call-function-of-screen1-in-screen2/1046573>\
**Category:** Questions about Thunkable X\
**Tags:** solved\
**Created:** [January 12, 2021, 7:04pm UTC](https://community.thunkable.com/t/solved-can-i-call-function-of-screen1-in-screen2/1046573 "2021-01-12T19:04:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![leena.ranexargq](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@leena.ranexargq](https://community.thunkable.com/u/leena.ranexargq)\
**Post date:** [January 12, 2021, 7:04pm UTC](https://community.thunkable.com/t/solved-can-i-call-function-of-screen1-in-screen2/1046573/1 "2021-01-12T19:04:13Z")

</div>

I would hate to paste function in each screen ☹

I want placement of buttons and labels and textboxes different for different screens but most of functionality when buttons are clicked is exactly same

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [January 12, 2021, 9:03pm UTC](https://community.thunkable.com/t/solved-can-i-call-function-of-screen1-in-screen2/1046573/2 "2021-01-12T21:03:18Z")

</div>

No you cannot make calls across screens. If the screens do nearly identical tasks, consider using 1 screen but change the visible property of controls or groups of controls

---

<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:** [January 12, 2021, 9:04pm UTC](https://community.thunkable.com/t/solved-can-i-call-function-of-screen1-in-screen2/1046573/3 "2021-01-12T21:04:45Z")

</div>

No. This is a big limitation of Thunkable. It has been requested at [Project-Wide (ie Global) Function Defnintions · Issue #703 · thunkable/thunkable-issues · GitHub](https://github.com/thunkable/thunkable-issues/issues/703) and it’s up for consideration.

The only way to do this effectively right now is to create a function _while making sure that you initialize variables in a separate screen_ (to avoid duplicating variable definitions in the next step…) and then save the screen\* and finally create a new screen using the saved screen as the source. That will copy the function to the second screen.

\*I’m not sure you can do this with the new drag-and-drop interface but you definitely can in the legacy interface.

---

<div class="post-metadata">

**Author:** ![leena.ranexargq](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@leena.ranexargq](https://community.thunkable.com/u/leena.ranexargq)\
**Post date:** [January 13, 2021, 7:25am UTC](https://community.thunkable.com/t/solved-can-i-call-function-of-screen1-in-screen2/1046573/4 "2021-01-13T07:25:11Z")

</div>

Thanks both of you

We are violating big principle of coding - Do not repeat code ☹

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [January 13, 2021, 9:47am UTC](https://community.thunkable.com/t/solved-can-i-call-function-of-screen1-in-screen2/1046573/6 "2021-01-13T09:47:08Z")

</div>

@eko.devs.apploroceo please try to provide more detailed answers when you reply to anything. I see that a lot of your replies are simply ‘use apis’ without suggesting APIs to use, or how to use them. Such answers will not help anybody. While it’s great to see that you are an active member of the community, your answers will not help anybody when help is the thing they are looking for. I don’t see how you could put blocks of code in a variable. Up to my understanding, a variable contains a value, and can be used between screens, but cannot hold functions and code.

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [January 13, 2021, 10:08am UTC](https://community.thunkable.com/t/solved-can-i-call-function-of-screen1-in-screen2/1046573/7 "2021-01-13T10:08:02Z")

</div>

> [@codeswept](#):
>
> it’s great to see that you are an active member of the community

Agreed - it’s great to have lots of folks sharing and helping one another with their apps.

* * *

> [@codeswept](#):
>
> please try to provide more detailed answers when you reply to anything

Also agreed. Since this question is specifically about using one function on multiple screens (which is currently not possible) I’m not sure why you were mentioning variables?

Tatiang has pointed out the best known work-around for this already, and Leena is right about trying to write “DRY” code.

It’s been great to see your knowledge increase during your time in the community @eko.devs.apploroceo - but please don’t just post for the sake of posting.

Thanks!

---

<div class="post-metadata">

**Author:** ![eko.devs.apploroceo](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eko.devs.apploroceo/32/93147_2.png) [@eko.devs.apploroceo](https://community.thunkable.com/u/eko.devs.apploroceo)\
**Post date:** [January 13, 2021, 10:26am UTC](https://community.thunkable.com/t/solved-can-i-call-function-of-screen1-in-screen2/1046573/9 "2021-01-13T10:26:01Z")

</div>

> [@codeswept](#):
>
> but cannot hold functions and code.

wat

i thought they can  
if i get time i can explain as a guide  
soon

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [January 13, 2021, 2:08pm UTC](https://community.thunkable.com/t/solved-can-i-call-function-of-screen1-in-screen2/1046573/10 "2021-01-13T14:08:21Z")

</div>

No, this is not possible. @leena.ranexargq I think that you can select all the code within a function and do Ctrl + C(control and the letter c) to copy the code and then paste it in another screen(Ctrl + V). It works for me even with large pieces of code. Use Command + C and Command + V if you are on a Mac.

---

<div class="post-metadata">

**Author:** ![leena.ranexargq](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@leena.ranexargq](https://community.thunkable.com/u/leena.ranexargq)\
**Post date:** [January 13, 2021, 3:05pm UTC](https://community.thunkable.com/t/solved-can-i-call-function-of-screen1-in-screen2/1046573/11 "2021-01-13T15:05:12Z")

</div>

Thanks @codeswept

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [January 14, 2021, 12:29am UTC](https://community.thunkable.com/t/solved-can-i-call-function-of-screen1-in-screen2/1046573/12 "2021-01-14T00:29:48Z")

</div>


