# Tag event script doesnt work

**URL:** <https://forum.inductiveautomation.com/t/tag-event-script-doesnt-work/22790>\
**Category:** Ignition\
**Created:** [February 21, 2019, 11:32pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-doesnt-work/22790 "2019-02-21T23:32:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ematschke](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ematschke/32/7544_2.png) [@ematschke](https://forum.inductiveautomation.com/u/ematschke)\
**Post date:** [February 21, 2019, 11:32pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-doesnt-work/22790/1 "2019-02-21T23:32:38Z")

</div>

trying to implement script for Value Changed in Tag Events.  
Script fails but no explanation.  
Tried Print to Console, but nothing shows up.  
Cannot find so called “wrapper log”

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [February 21, 2019, 11:57pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-doesnt-work/22790/2 "2019-02-21T23:57:08Z")

</div>

Can you post the script?  
Also you can right click the tag, choose diagnostics and it will show the status and any errors.

---

<div class="post-metadata">

**Author:** ![ematschke](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ematschke/32/7544_2.png) [@ematschke](https://forum.inductiveautomation.com/u/ematschke)\
**Post date:** [November 4, 2019, 8:08pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-doesnt-work/22790/3 "2019-11-04T20:08:33Z")

</div>

Well I would love to post the actual script, but I can’t even copy it out of the editor.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/eb4432c8710dc680eb7d733b8ccfec73c205cf0a.png)  
This is in a UDT. I have dumbed it down to just try to write simple values to a couple client tags. Nothing happens.  
The instance of the UDT is valid and the source value does change as I have components on a window tied to the tag.  
Diagnostic Logs in gateway shows nothing related to this.  
Diagnostic Console shows nothing.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 4, 2019, 8:12pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-doesnt-work/22790/4 "2019-11-04T20:12:56Z")

</div>

You can’t write to tags in the `[Client]` provider from a tag event script, because tag events occur on the gateway. The `[Client]` provider is only available from within the scope of an individual client. You can probably use a [client tag change script](https://docs.inductiveautomation.com/display/DOC80/Client+Event+Scripts#ClientEventScripts-GatewayEventsversusClientEvents) for the same purpose.

---

<div class="post-metadata">

**Author:** ![ematschke](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ematschke/32/7544_2.png) [@ematschke](https://forum.inductiveautomation.com/u/ematschke)\
**Post date:** [November 4, 2019, 8:39pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-doesnt-work/22790/5 "2019-11-04T20:39:25Z")

</div>

Thanks. I got to thinking that after posting and tried a test gateway tag instead and it does indeed write to that tag. Is this also why it won’t call a project script module? The gateway log says global name ‘Project’ is not defined. Is there any way to call the script from a gateway tag event?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 4, 2019, 8:52pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-doesnt-work/22790/6 "2019-11-04T20:52:55Z")

</div>

Upgrade to 8.0? In 8, this isn’t a problem, because there is no special “global” project - we create an inheritable parent project that’s _called_ `global` on upgrade, but it’s a perfectly normal project that you’re free to edit and delete as appropriate - and there’s a proper inheritance model for projects, so `global` can define resources that are usable in `child` and `grandchild` and so on.

But, being more practical, could you just move your script code into the ‘shared’ library?
