# What is the correct way to use runScript in UDT Expression Tag?

**URL:** <https://forum.inductiveautomation.com/t/what-is-the-correct-way-to-use-runscript-in-udt-expression-tag/83111>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [December 13, 2023, 8:47pm UTC](https://forum.inductiveautomation.com/t/what-is-the-correct-way-to-use-runscript-in-udt-expression-tag/83111 "2023-12-13T20:47:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eagel007](https://avatars.discourse-cdn.com/v4/letter/e/7bcc69/32.png) [@Eagel007](https://forum.inductiveautomation.com/u/Eagel007)\
**Post date:** [December 13, 2023, 8:47pm UTC](https://forum.inductiveautomation.com/t/what-is-the-correct-way-to-use-runscript-in-udt-expression-tag/83111/1 "2023-12-13T20:47:56Z")

</div>

Hi There,

I have a script in Project library with Gateway Scope, which I am trying to use in UDT Expression tag. As a parameter to script, I am passing a tag address from MQTT Engine. I read the manual but its still not working.

here is the script.  
runScript('myscript.myfunction',0,"[MQTT Engine]/Test/filler")

Is there anything wrong with this script? what is the correct way?

thanks

---

<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:** [December 13, 2023, 9:03pm UTC](https://forum.inductiveautomation.com/t/what-is-the-correct-way-to-use-runscript-in-udt-expression-tag/83111/2 "2023-12-13T21:03:33Z")

</div>

You're passing the tag path as a string. It may be the correct way, if your script does expect a path and uses `system.tag.readBlocking`, but if it expects the tag value, you need to use `{[MQTT Engine]/Test/filler}`

---

<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:** [December 13, 2023, 9:18pm UTC](https://forum.inductiveautomation.com/t/what-is-the-correct-way-to-use-runscript-in-udt-expression-tag/83111/3 "2023-12-13T21:18:56Z")

</div>

You may also need to configure the project containing `myscript` as the Gateway Scripting Project. (Only one project can be the gateway scripting project, so if set to something else, you'll have to consolidate those projects.)

---

<div class="post-metadata">

**Author:** ![Eagel007](https://avatars.discourse-cdn.com/v4/letter/e/7bcc69/32.png) [@Eagel007](https://forum.inductiveautomation.com/u/Eagel007)\
**Post date:** [December 13, 2023, 9:31pm UTC](https://forum.inductiveautomation.com/t/what-is-the-correct-way-to-use-runscript-in-udt-expression-tag/83111/4 "2023-12-13T21:31:04Z")

</div>

yes the script uses system.tag.readBlocking and path I am providing as a string.

---

<div class="post-metadata">

**Author:** ![Eagel007](https://avatars.discourse-cdn.com/v4/letter/e/7bcc69/32.png) [@Eagel007](https://forum.inductiveautomation.com/u/Eagel007)\
**Post date:** [December 13, 2023, 9:32pm UTC](https://forum.inductiveautomation.com/t/what-is-the-correct-way-to-use-runscript-in-udt-expression-tag/83111/5 "2023-12-13T21:32:03Z")

</div>

Should this be an inheritable project?

---

<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:** [December 13, 2023, 9:45pm UTC](https://forum.inductiveautomation.com/t/what-is-the-correct-way-to-use-runscript-in-udt-expression-tag/83111/6 "2023-12-13T21:45:10Z")

</div>

No it doesn't have to be.
