# Unable to call shared script from tag event script

**URL:** <https://forum.inductiveautomation.com/t/unable-to-call-shared-script-from-tag-event-script/11381>\
**Category:** General Discussion\
**Created:** [March 17, 2016, 6:18pm UTC](https://forum.inductiveautomation.com/t/unable-to-call-shared-script-from-tag-event-script/11381 "2016-03-17T18:18:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pratul](https://avatars.discourse-cdn.com/v4/letter/p/3ab097/32.png) [@pratul](https://forum.inductiveautomation.com/u/pratul)\
**Post date:** [March 17, 2016, 6:18pm UTC](https://forum.inductiveautomation.com/t/unable-to-call-shared-script-from-tag-event-script/11381/1 "2016-03-17T18:18:51Z")

</div>

Hello,

I am unable to call a function inside a script which is under the shared script library from a tag event script.

Can someone guide me how to do that?

I have a created a script called sharedscript1 inside ‘shared’ library package.  
Hence I am assuming that this script since it is global, it must be visible to the tag event script.  
I am trying to call a function inside sharedscript1 from a tag event script once the value of the tag changes.

It throws me an error on the console:

Traceback (most recent call last):  
File “tagevent:valueChanged”, line 28, in valueChanged  
NameError: global name ‘shared’ is not defined

Thanks!

---

<div class="post-metadata">

**Author:** ![pratul](https://avatars.discourse-cdn.com/v4/letter/p/3ab097/32.png) [@pratul](https://forum.inductiveautomation.com/u/pratul)\
**Post date:** [March 17, 2016, 7:19pm UTC](https://forum.inductiveautomation.com/t/unable-to-call-shared-script-from-tag-event-script/11381/2 "2016-03-17T19:19:23Z")

</div>

I think I got this resolved. I did not commit changes in my Gateway script by publishing it to the gateway and project.

Now its working!
