# Using runScript() to define the value for an expression tag

**URL:** <https://forum.inductiveautomation.com/t/using-runscript-to-define-the-value-for-an-expression-tag/8038>\
**Category:** Ignition\
**Created:** [February 20, 2014, 11:20pm UTC](https://forum.inductiveautomation.com/t/using-runscript-to-define-the-value-for-an-expression-tag/8038 "2014-02-20T23:20:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamthebull](https://avatars.discourse-cdn.com/v4/letter/i/58f4c7/32.png) [@iamthebull](https://forum.inductiveautomation.com/u/iamthebull)\
**Post date:** [February 20, 2014, 11:20pm UTC](https://forum.inductiveautomation.com/t/using-runscript-to-define-the-value-for-an-expression-tag/8038/1 "2014-02-20T23:20:51Z")

</div>

I’m having trouble using the runScript() expression function to set the value of an expression tag.

I first created a new project script called myTest. The function is defined as follows:

```auto
def myTest(num):
   return num
```

If I call this function in an actionPerformed event on a button then the script function executes just fine. The syntax used in this case is:

```auto
a = app.MyScripts.TestScripts.myTest('test')
print a
```

But if I try to call this function to define the value for an expression tag, then the tag quality always shows as ‘Evaluation Error’. The syntax I use to call the function is:

```auto
runScript("app.MyScripts.TestScripts.myTest('test')")
```

Any suggestions on what I may be doing wrong? I’ve attached some screen shots as well.

---

<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:** [February 20, 2014, 11:27pm UTC](https://forum.inductiveautomation.com/t/using-runscript-to-define-the-value-for-an-expression-tag/8038/2 "2014-02-20T23:27:58Z")

</div>

You cannot call an app.\* module function in runScript on an expression tag.

The reason is because expression tags do not belong to any project but app.\* modules and functions do. So an expression tag doesn’t know which project’s app.\* module you might be referring to.

This will probably change in Ignition 7.7 when multi-project Python modules can be added.
