# How do I execute a transaction group triggered by a tag that is not part of the group

**URL:** <https://forum.inductiveautomation.com/t/how-do-i-execute-a-transaction-group-triggered-by-a-tag-that-is-not-part-of-the-group/110883>\
**Category:** Ignition\
**Created:** [September 23, 2025, 11:12am UTC](https://forum.inductiveautomation.com/t/how-do-i-execute-a-transaction-group-triggered-by-a-tag-that-is-not-part-of-the-group/110883 "2025-09-23T11:12:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bweisenburger](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@bweisenburger](https://forum.inductiveautomation.com/u/bweisenburger)\
**Post date:** [September 23, 2025, 11:12am UTC](https://forum.inductiveautomation.com/t/how-do-i-execute-a-transaction-group-triggered-by-a-tag-that-is-not-part-of-the-group/110883/1 "2025-09-23T11:12:55Z")

</div>

I have a transaction group that writes data to my sql database. I would like to trigger this group to write once to my database when an unrelated opc tag goes high.

---

<div class="post-metadata">

**Author:** ![robertm](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@robertm](https://forum.inductiveautomation.com/u/robertm)\
**Post date:** [September 23, 2025, 11:20am UTC](https://forum.inductiveautomation.com/t/how-do-i-execute-a-transaction-group-triggered-by-a-tag-that-is-not-part-of-the-group/110883/2 "2025-09-23T11:20:53Z")

</div>

Personally, I would use a gateway tag change script and write the SQL store call within the script as opposed to using the transaction group.

---

<div class="post-metadata">

**Author:** ![bweisenburger](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@bweisenburger](https://forum.inductiveautomation.com/u/bweisenburger)\
**Post date:** [September 23, 2025, 11:53am UTC](https://forum.inductiveautomation.com/t/how-do-i-execute-a-transaction-group-triggered-by-a-tag-that-is-not-part-of-the-group/110883/4 "2025-09-23T11:53:41Z")

</div>

Ok, I just read a little bit about the gateway event scripsand watched a video. I right clicked on Project Library and selected New Script. The window opened to write a script, however, there was no column on the left that has the ways to trigger it. I don’t see the Startup, Update, Shutdown, Timer, Tag Change, Message, and Scheduled options that I was in the video that I watched.

---

<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:** [September 23, 2025, 11:58am UTC](https://forum.inductiveautomation.com/t/how-do-i-execute-a-transaction-group-triggered-by-a-tag-that-is-not-part-of-the-group/110883/5 "2025-09-23T11:58:05Z")

</div>

> [@bweisenburger](#):
>
> I don’t see the Startup, Update ....

Those aren't in the project library. Those are in the gateway events dialog, adjacent to the project library.

(It is recommended, for various reasons, to have the actual code in the project library as a function and called as a one-liner from the event.)

---

<div class="post-metadata">

**Author:** ![bweisenburger](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@bweisenburger](https://forum.inductiveautomation.com/u/bweisenburger)\
**Post date:** [September 23, 2025, 12:07pm UTC](https://forum.inductiveautomation.com/t/how-do-i-execute-a-transaction-group-triggered-by-a-tag-that-is-not-part-of-the-group/110883/6 "2025-09-23T12:07:54Z")

</div>

Got it,

Now, if I create the script in project library and it is named “Low\_Pressure\_Alarm”, what is the one-liner that I use in the gateway events that calls that function?

I have Insert Into Alarms (ID, MachineNumber,AlarmDate,AlarmNumber,AlarmData)

ID is an autonumber field. Should I leave it out? If so, do I start with a “,” in the values?

Values (,1,now(),1,opc tag)

How do I insert an opc tag for the AlarmData field?

---

<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:** [September 23, 2025, 12:21pm UTC](https://forum.inductiveautomation.com/t/how-do-i-execute-a-transaction-group-triggered-by-a-tag-that-is-not-part-of-the-group/110883/7 "2025-09-23T12:21:14Z")

</div>

Project library scripts, as full scripts, are only executed **once** , when first referenced. You are expected to use python `def` to create named functions in the script, along with any global constants you might want. (Best to do any imports outside of any `def`, too.)

The one-liner for a tag change event would be something like:

```python
Low_Pressure_Alarm.someFunctionName(event, initialChange, newValue, previousValue)

```

(Consider naming the script more generically and creating appropriately named functions within.)

The `newValue` will be the QualifiedValue for just the subscribed tag. You will need to use `system.tag.readBlocking()` to retrieve the other tags you want to process.

---

<div class="post-metadata">

**Author:** ![bweisenburger](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@bweisenburger](https://forum.inductiveautomation.com/u/bweisenburger)\
**Post date:** [September 24, 2025, 5:39pm UTC](https://forum.inductiveautomation.com/t/how-do-i-execute-a-transaction-group-triggered-by-a-tag-that-is-not-part-of-the-group/110883/8 "2025-09-24T17:39:02Z")

</div>

I created a read only reference tag in my transaction group and triggered off of it.

Seems to work good.

---

<div class="post-metadata">

**Author:** ![Clancy\_Cavanaugh](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@Clancy\_Cavanaugh](https://forum.inductiveautomation.com/u/Clancy_Cavanaugh)\
**Post date:** [September 24, 2025, 5:53pm UTC](https://forum.inductiveautomation.com/t/how-do-i-execute-a-transaction-group-triggered-by-a-tag-that-is-not-part-of-the-group/110883/9 "2025-09-24T17:53:36Z")

</div>

This was going to be my suggestion. If you want a handshake back to confirm that the transaction group completed, you can also add a read only tag for that. Read only in this case just means that the tag does not get written to the SQL table.
