# Gateway Tag Event Scripts

**URL:** <https://forum.inductiveautomation.com/t/gateway-tag-event-scripts/21292>\
**Category:** Ignition\
**Created:** [December 7, 2018, 5:18pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-event-scripts/21292 "2018-12-07T17:18:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GreggCavazos](https://avatars.discourse-cdn.com/v4/letter/g/90db22/32.png) [@GreggCavazos](https://forum.inductiveautomation.com/u/GreggCavazos)\
**Post date:** [December 7, 2018, 5:18pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-event-scripts/21292/1 "2018-12-07T17:18:31Z")

</div>

I’ve been doing some research, but I cannot find a solution.

We started using Gateway Tag Event Scripts and its working as expected, the current design requires to suscribe/add all tags under a folder (including subfolders), but every time we add a new tag, someone needs to go manually and add the tagpath in the corresponding script.

Is there a way to programmatically add tags to the list?

We have a script to find all the tags in the folder, but we cannot find a way to add them to the Gateway TAG change event definition.

Thanks,

---

<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 7, 2018, 5:27pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-event-scripts/21292/2 "2018-12-07T17:27:37Z")

</div>

> [@GreggCavazos](#):
>
> Is there a way to programmatically add tags to the list?

Unfortunately, no. It might be possible if one dug around in the resource types in the Java SDK, but it probably wouldn't be simple.  
However, if you truly need dynamic tag listeners, you could create jython implementations of the SDK TagListener class and manually subscribe them. Still not simple.

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [December 7, 2018, 6:01pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-event-scripts/21292/3 "2018-12-07T18:01:03Z")

</div>

Sounds like a good use case for UDTs with tag event scripts.

---

<div class="post-metadata">

**Author:** ![GreggCavazos](https://avatars.discourse-cdn.com/v4/letter/g/90db22/32.png) [@GreggCavazos](https://forum.inductiveautomation.com/u/GreggCavazos)\
**Post date:** [December 7, 2018, 6:39pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-event-scripts/21292/4 "2018-12-07T18:39:42Z")

</div>

I will take a look at them, to see if we can use this approach.

Thanks,
