# runScript in expression tag errors

**URL:** <https://forum.inductiveautomation.com/t/runscript-in-expression-tag-errors/75117>\
**Category:** Ignition\
**Tags:** ignition81, scripting, perspective\
**Created:** [June 16, 2023, 1:10am UTC](https://forum.inductiveautomation.com/t/runscript-in-expression-tag-errors/75117 "2023-06-16T01:10:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![r123](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@r123](https://forum.inductiveautomation.com/u/r123)\
**Post date:** [June 16, 2023, 1:10am UTC](https://forum.inductiveautomation.com/t/runscript-in-expression-tag-errors/75117/1 "2023-06-16T01:10:57Z")

</div>

Quality Diagnostics Error executing script for runScript() expression:Test.myFunc() WARN

I found a few posts about this issue but I did not upgrade to 8.1 and the Gateway Scripting Project setting is now set to "global".

> [@Runscript() not working after upgrading from 7.9 to 8](https://forum.inductiveautomation.com/t/runscript-not-working-after-upgrading-from-7-9-to-8/23993):
>
> As per the above. I have a series of expression tags that run shared scripts to return values. These worked fine before the upgrade to 8, but won’t work at all. I even created a new expression tag and script using this example from the help, and again can’t get it to work: [https://docs.inductiveautomation.com/display/DOC80/runScript](https://docs.inductiveautomation.com/display/DOC80/runScript) I’m sure it’s something obvious, but at the moment i’m stuck!

I also setup the simple test script that runs in the Script Console but will not run in the expression tag.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/7/d72d1d579dee462ecd1fedfe2363d2118bb26ab6.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/5/852786fc1842edc35fcc517d12c7b70064089e74.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/7/e79ecef669c9741c6eea219713c8012effea85cf.png)

---

<div class="post-metadata">

**Author:** ![r123](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@r123](https://forum.inductiveautomation.com/u/r123)\
**Post date:** [June 16, 2023, 5:45pm UTC](https://forum.inductiveautomation.com/t/runscript-in-expression-tag-errors/75117/2 "2023-06-16T17:45:12Z")

</div>

Ok, it looks like Gateway Scripting Project needs to be set to the current application name for the expression tag to be able to run the Project Library script.

I'd read a number of posts about setting it to global but I guess that is only if you are running an older Ignition version and or upgraded to 8, then there will be a Global object in the gateway?

So a new Ignition 8 application by default can't run Project Library scripts from expression tags unless you go into the System settings, Gateway Settings and then add the project name to the Gateway Scripting Project setting.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 16, 2023, 6:21pm UTC](https://forum.inductiveautomation.com/t/runscript-in-expression-tag-errors/75117/3 "2023-06-16T18:21:44Z")

</div>

The scripting project can be set to whatever you want. The only thing required is that the scripts you want to run through tag events and such need to be on this scripting project.

So, in your case, your script is in your current project, you set the scripting project to it, everything works.

But keep in mind that if you create more projects on the same gateway, you might run into issues.  
It's a good idea to have a project dedicated to scripts that need to be run from the gateway, and use it as the scripting project.  
You can even inherit from it to bring those scripts into projects scope.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 16, 2023, 8:39pm UTC](https://forum.inductiveautomation.com/t/runscript-in-expression-tag-errors/75117/4 "2023-06-16T20:39:32Z")

</div>

> [@r123](#):
>
> add the project name to the Gateway Scripting Project setting.

Not "add". "Set." There can be only one.

If you want to share some scripts between many other projects, consider an inheritance scheme where those common scripts are at the inheritance root project, from which your UIs and your global scripting projects separately inherit them.

---

<div class="post-metadata">

**Author:** ![r123](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@r123](https://forum.inductiveautomation.com/u/r123)\
**Post date:** [June 16, 2023, 10:06pm UTC](https://forum.inductiveautomation.com/t/runscript-in-expression-tag-errors/75117/5 "2023-06-16T22:06:46Z")

</div>

> [@pturmel](#):
>
> Not "add". "Set." There can be only one.

That was the understanding. It would be very useful otherwise. 🙂
