# Manually trigger event script on tag

**URL:** <https://forum.inductiveautomation.com/t/manually-trigger-event-script-on-tag/90495>\
**Category:** Ignition\
**Created:** [May 16, 2024, 1:26pm UTC](https://forum.inductiveautomation.com/t/manually-trigger-event-script-on-tag/90495 "2024-05-16T13:26:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![justin.huggins](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@justin.huggins](https://forum.inductiveautomation.com/u/justin.huggins)\
**Post date:** [May 16, 2024, 1:26pm UTC](https://forum.inductiveautomation.com/t/manually-trigger-event-script-on-tag/90495/1 "2024-05-16T13:26:08Z")

</div>

I currently have an event script built on a tag that publishes MQTT data on change. Works great, not an issue with the script. What I am running into is tags that do not change frequently. I really need for the tags to publish at least once a day for downstream reporting whether it changes or not. Is it possible to fire it manually from another source such as another tag or gateway script? Any other way to accomplish something like this?

---

<div class="post-metadata">

**Author:** ![rfolkes](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@rfolkes](https://forum.inductiveautomation.com/u/rfolkes)\
**Post date:** [May 16, 2024, 1:44pm UTC](https://forum.inductiveautomation.com/t/manually-trigger-event-script-on-tag/90495/2 "2024-05-16T13:44:30Z")

</div>

> [@justin.huggins](#):
>
> ually from another source such as another ta

Put the script into a function in the Project Library. Use the tag change script you are running to fire the script from the Project Library and use a Gateway Events Scheduled script to trigger it daily

---

<div class="post-metadata">

**Author:** ![justin.huggins](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@justin.huggins](https://forum.inductiveautomation.com/u/justin.huggins)\
**Post date:** [May 16, 2024, 5:11pm UTC](https://forum.inductiveautomation.com/t/manually-trigger-event-script-on-tag/90495/3 "2024-05-16T17:11:45Z")

</div>

I am working on this solution. Any idea what the syntax is for referencing the script via the tag on change event? It is running on the same gateway. It runs fine in the script console, but not on the tag.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/b/4bc25724c54e46788d1a83d05ddb8513cfc61c33.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/8/681b86d32bef097825f3de2b6349a1e713f3fd3c.png)

---

<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:** [May 16, 2024, 5:17pm UTC](https://forum.inductiveautomation.com/t/manually-trigger-event-script-on-tag/90495/4 "2024-05-16T17:17:02Z")

</div>

> **[Project Library | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/platform/scripting/scripting-in-ignition/project-library#gateway-scripting-project)**
>
> Scripts under the Project Library are a project-based resource that allows user created Python scripts to be configured. Objects and functions created in a Project Library script can be called from anywhere in the project. Project Library scripts are...

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 16, 2024, 5:33pm UTC](https://forum.inductiveautomation.com/t/manually-trigger-event-script-on-tag/90495/5 "2024-05-16T17:33:00Z")

</div>

Tip: post code rather than pictures of code so that we don't have to type it all out to try it or modify it in our answers. Post a screengrab as well if context is important. See [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831).

---

<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 16, 2024, 5:37pm UTC](https://forum.inductiveautomation.com/t/manually-trigger-event-script-on-tag/90495/6 "2024-05-16T17:37:24Z")

</div>

You should be careful with this. You are making a network call from a tag's valueChange event. Events that take more than single digit milliseconds to execute can lead to gateway tag subsystem lockup.

---

<div class="post-metadata">

**Author:** ![justin.huggins](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@justin.huggins](https://forum.inductiveautomation.com/u/justin.huggins)\
**Post date:** [May 16, 2024, 8:45pm UTC](https://forum.inductiveautomation.com/t/manually-trigger-event-script-on-tag/90495/7 "2024-05-16T20:45:11Z")

</div>

Thanks.

I originally was just calling from a valueChange script directly, but was barely publishing due to this being on a UDT with several simultaneous publishes. Due to a bug in the MQTT Engine module I am having to get creative as a work around for now. This is not really my ideal way either, just trying to find some alternative ways to capture the same thing with potential better performance.
