# Gateway Scripts - Using variables from one script in another

**URL:** <https://forum.inductiveautomation.com/t/gateway-scripts-using-variables-from-one-script-in-another/63614>\
**Category:** Ignition\
**Tags:** perspective, ignition81, scripting\
**Created:** [August 30, 2022, 5:16pm UTC](https://forum.inductiveautomation.com/t/gateway-scripts-using-variables-from-one-script-in-another/63614 "2022-08-30T17:16:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 30, 2022, 5:21pm UTC](https://forum.inductiveautomation.com/t/gateway-scripts-using-variables-from-one-script-in-another/63614/2 "2022-08-30T17:21:57Z")

</div>

Absolutely just pass them as parameters to your next script.

```auto
def function1():
     # really long script here
     variable1='blah'
     # etc with what you need to pass
     someOtherLibraryScript.function2(variable1, variable2)

```

and then in your other function

```auto
def function2(param1, param2):
    # param1 now has value of variable1 from script 1
    # param2 now has value of variable1 from script 1

```

How long is your script exactly? I would highly recommend trying to break it down to smaller scripts. Take a look at this post for an example [system.util.invokeLater or alternative function in global script? - #6 by bkarabinchak.psi](https://forum.inductiveautomation.com/t/system-util-invokelater-or-alternative-function-in-global-script/42529/6)

---

_[View the full topic](https://forum.inductiveautomation.com/t/gateway-scripts-using-variables-from-one-script-in-another/63614)._
