# Expression 'runScript' fails to run script from module

**URL:** <https://forum.inductiveautomation.com/t/expression-runscript-fails-to-run-script-from-module/7365>\
**Category:** Ignition\
**Created:** [October 3, 2013, 6:00pm UTC](https://forum.inductiveautomation.com/t/expression-runscript-fails-to-run-script-from-module/7365 "2013-10-03T18:00:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlangdon](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mlangdon](https://forum.inductiveautomation.com/u/mlangdon)\
**Post date:** [October 3, 2013, 6:00pm UTC](https://forum.inductiveautomation.com/t/expression-runscript-fails-to-run-script-from-module/7365/1 "2013-10-03T18:00:29Z")

</div>

Using 7.6.3 in Windows Server.

If I do `runScript(int('20'), 10000)` that runs fine.

However, if I define a function in the script module as ‘app.test.run()’

`def run(strint):
   return int(strint)`

And call thusly in an Expression tag:

```auto
runScript("app.test.run('20')", 10000)
```

Nothing. Just the dread red x and null. And nothing shows up in the console. Same deal with non-trivial functions that work in the playground.

Am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![mlangdon](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mlangdon](https://forum.inductiveautomation.com/u/mlangdon)\
**Post date:** [October 3, 2013, 6:09pm UTC](https://forum.inductiveautomation.com/t/expression-runscript-fails-to-run-script-from-module/7365/2 "2013-10-03T18:09:57Z")

</div>

And I figured out the reason it won’t run is that it’s in a non-Client Expression tag.

Is there not a way to run multi-line python code in a non-Client tag?

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [October 3, 2013, 8:48pm UTC](https://forum.inductiveautomation.com/t/expression-runscript-fails-to-run-script-from-module/7365/3 "2013-10-03T20:48:12Z")

</div>

You are right, the app.\* functions are in the project and SQLTags are not (except for Client Tags) so there is no way to call app.\* from an Expression Tag. There is a sneaky way to get around the one line of code limitation, but it will be difficult to troubleshoot errors. You can use the newline character (\n) in a script to create multiple lines of code.`runScript("myvar=5\nreturn myvar")`

---

<div class="post-metadata">

**Author:** ![mlangdon](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mlangdon](https://forum.inductiveautomation.com/u/mlangdon)\
**Post date:** [October 4, 2013, 3:02pm UTC](https://forum.inductiveautomation.com/t/expression-runscript-fails-to-run-script-from-module/7365/4 "2013-10-04T15:02:42Z")

</div>

So I guess my feature request would be a callable gateway script module 😛

Glad I found a workaround to my issue, because I’m not going anywhere near that newline hack.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [October 4, 2013, 3:10pm UTC](https://forum.inductiveautomation.com/t/expression-runscript-fails-to-run-script-from-module/7365/5 "2013-10-04T15:10:30Z")

</div>

Global Script Modules are planned for Ignition 7.7: [viewtopic.php?f=70&t=11069](http://inductiveautomation.com/forum/viewtopic.php?f=70&t=11069)

These should be callable from runScript.
