# Ignition 8 Tag Event Script

**URL:** <https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602>\
**Category:** General Discussion\
**Tags:** ignition80\
**Created:** [May 2, 2019, 4:17pm UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602 "2019-05-02T16:17:10Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaoloPK](https://avatars.discourse-cdn.com/v4/letter/p/ba8739/32.png) [@PaoloPK](https://forum.inductiveautomation.com/u/PaoloPK)\
**Post date:** [May 2, 2019, 4:17pm UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/1 "2019-05-02T16:17:10Z")

</div>

Hi,  
I created two projects,  
Automation is the real one,  
Automation\_script has only scripts to share:

 ![tag_01](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/007febc7e1ccebc30e97b3e8337dd196d73fff3c.jpeg)

On Automation\_scrip I imported the old scripts

![tag_02](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/14486a36843e1bc658dbe57610650465817983c3.jpeg)

On Automation they complete correctly

![tag_03](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/464a0bfc6e0a3e05ae3d6c4eb947fc2b0ebf8b82.jpeg)

if I use a button to call up the function everything goes correctly

 ![tag_04](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/204b5d642c092150091b8de832ecdef1ac057ec1.jpeg)

If I insert the same function in the Tag \> Tag Event Script

 ![tag_05](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/58f4d23977909e21f481c1188629ea6e4db7aaa3.jpeg)

Now what I don’t understand,  
**NameError: global name ‘shared’ is not defined**  
??

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 2, 2019, 4:23pm UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/2 "2019-05-02T16:23:36Z")

</div>

There were some bugs around this in the 8.0.0 release - can you try 8.0.1-rc1?

---

<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:** [May 2, 2019, 4:24pm UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/3 "2019-05-02T16:24:12Z")

</div>

~~Ignition v8 has a whole different architecture for shared scripts. If you restore a complete gateway backup, it’ll create a parent project to replace the shared environment, but if you import project by project, you have to shuffle the structure yourself. ‘shared’ won’t exist, as you’ve experienced.~~

Sorry, didn’t look close at your inheritance diagram… /-:

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [May 2, 2019, 4:29pm UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/4 "2019-05-02T16:29:09Z")

</div>

Absolutely try upgrading to 8.0.1-rc1, but to clarify, is the `Automation_script` project configured as the Gateway Scripting Project?

Gateway \> Config \> Gateway Settings \> Gateway Scripting Project (at the bottom of the page).

---

<div class="post-metadata">

**Author:** ![PaoloPK](https://avatars.discourse-cdn.com/v4/letter/p/ba8739/32.png) [@PaoloPK](https://forum.inductiveautomation.com/u/PaoloPK)\
**Post date:** [May 3, 2019, 6:34am UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/5 "2019-05-03T06:34:07Z")

</div>

Hi,  
y use the release 8.0.1-rc1

 ![tag_06](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/e7823232d008c73b5ae6bae51cfefc1a071386a8.jpeg)

this is the Gateway Scripting Project

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 3, 2019, 2:05pm UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/6 "2019-05-03T14:05:35Z")

</div>

According to your other screenshots you should have the value “Automation\_script” for that setting, not “globals”.

---

<div class="post-metadata">

**Author:** ![PaoloPK](https://avatars.discourse-cdn.com/v4/letter/p/ba8739/32.png) [@PaoloPK](https://forum.inductiveautomation.com/u/PaoloPK)\
**Post date:** [May 6, 2019, 1:49pm UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/7 "2019-05-06T13:49:45Z")

</div>

![script_5](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/1e1fe1964992029f88a4fa3a083a5f8309c55b22.jpeg)

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [May 6, 2019, 4:29pm UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/8 "2019-05-06T16:29:38Z")

</div>

Right, you do not have a project named `globals`, so we need to update the scripting project for your gateway.

Navigate back to the Gateway Scripting Project property in my earlier post, and set it to `Automazione_script`, and Save Changes.

---

<div class="post-metadata">

**Author:** ![PaoloPK](https://avatars.discourse-cdn.com/v4/letter/p/ba8739/32.png) [@PaoloPK](https://forum.inductiveautomation.com/u/PaoloPK)\
**Post date:** [May 8, 2019, 7:17am UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/9 "2019-05-08T07:17:34Z")

</div>

![script_6](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/e21e56aa25a634380346c0e8a4b9df31d8384b92.jpeg)

Ok, perfect.

---

<div class="post-metadata">

**Author:** ![heybales](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/heybales/32/3358_2.png) [@heybales](https://forum.inductiveautomation.com/u/heybales)\
**Post date:** [July 19, 2019, 4:55pm UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/10 "2019-07-19T16:55:31Z")

</div>

hey Paul. thanks for this post. I was struggling to get tag event scripts working with libraries, and didn’t know about this new Gateway setting.

This page in the 8.0 documentation really needs updating.  
[https://docs.inductiveautomation.com/display/DOC80/Project+and+Shared+Scripts](https://docs.inductiveautomation.com/display/DOC80/Project+and+Shared+Scripts)  
I understand there’s lots do in documentation, but IMO, this is high priority since previous behavior changed and the information here is incorrect.

Also, this page should define how library routines can be accessed by the tag event script.  
[https://docs.inductiveautomation.com/display/DOC80/Tag+Event+Scripts](https://docs.inductiveautomation.com/display/DOC80/Tag+Event+Scripts)

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [July 19, 2019, 9:52pm UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/11 "2019-07-19T21:52:01Z")

</div>

> [@heybales](#):
>
> I understand there’s lots [to] do in documentation

My friend, that is an understatement. 😅

Joking aside, I agree. This Gateway Scripting Project concept was a major change that seems to have gotten lost in the shuffle. We apologize for the headaches that the outdated page caused.

I went rogue and created a quick replacement page: [https://docs.inductiveautomation.com/display/DOC80/Project+Library](https://docs.inductiveautomation.com/display/DOC80/Project+Library)

Additionally, I added a small heading and link on the Tag Event Scripts page linking back to the relevant information on the Project Library page, as you suggested. I'd like to spend a bit more time on the Project Library page and add some additional content (adding extra examples and such), but hopefully the changes on the page now should prevent folks from running into the same troubles.

---

<div class="post-metadata">

**Author:** ![heybales](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/heybales/32/3358_2.png) [@heybales](https://forum.inductiveautomation.com/u/heybales)\
**Post date:** [July 23, 2019, 5:25pm UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/12 "2019-07-23T17:25:09Z")

</div>

Perfect! I took a look at the new page, and I think it looks great.

Nicely done! Once again the IA team exceeding expectations.

---

<div class="post-metadata">

**Author:** ![dion.botha](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dion.botha](https://forum.inductiveautomation.com/u/dion.botha)\
**Post date:** [April 23, 2020, 9:23pm UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/13 "2020-04-23T21:23:52Z")

</div>

Can we use a list of projects or only 1?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/822d5018b27238db2271569f2d30d1a8dc8a385d.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 23, 2020, 9:27pm UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/14 "2020-04-23T21:27:13Z")

</div>

It’s just 1.

---

<div class="post-metadata">

**Author:** ![PaoloPK](https://avatars.discourse-cdn.com/v4/letter/p/ba8739/32.png) [@PaoloPK](https://forum.inductiveautomation.com/u/PaoloPK)\
**Post date:** [April 24, 2020, 8:49am UTC](https://forum.inductiveautomation.com/t/ignition-8-tag-event-script/24602/15 "2020-04-24T08:49:00Z")

</div>

solve it thanks
