# Need to update certain tags based on the value change of one tag

**URL:** <https://forum.inductiveautomation.com/t/need-to-update-certain-tags-based-on-the-value-change-of-one-tag/62152>\
**Category:** Ignition\
**Tags:** ignition80, database, scripting, perspective, ignition81\
**Created:** [July 21, 2022, 6:14am UTC](https://forum.inductiveautomation.com/t/need-to-update-certain-tags-based-on-the-value-change-of-one-tag/62152 "2022-07-21T06:14:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Killmonger](https://avatars.discourse-cdn.com/v4/letter/k/3da27b/32.png) [@Killmonger](https://forum.inductiveautomation.com/u/Killmonger)\
**Post date:** [July 21, 2022, 6:14am UTC](https://forum.inductiveautomation.com/t/need-to-update-certain-tags-based-on-the-value-change-of-one-tag/62152/1 "2022-07-21T06:14:14Z")

</div>

Hi, I have a UDT of 5 pumps, they have the same named 10 tags each, I need to store the other 9 tags for each of those 5 pumps on the basis of a change of one tag(same for all pumps) for each pump. I need to store it in my SQL DB in the same table as the change event tag refreshes for each pump. Can someone help regarding the same? I am very new to ignition and need some catching up, kindly request elaborate a bit while writing your answers, please…

---

<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:** [July 21, 2022, 6:20am UTC](https://forum.inductiveautomation.com/t/need-to-update-certain-tags-based-on-the-value-change-of-one-tag/62152/2 "2022-07-21T06:20:34Z")

</div>

Start by reading up on [Understanding Transaction Groups - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Understanding+Transaction+Groups) and watching the video tutorial linked on that page.

---

<div class="post-metadata">

**Author:** ![Killmonger](https://avatars.discourse-cdn.com/v4/letter/k/3da27b/32.png) [@Killmonger](https://forum.inductiveautomation.com/u/Killmonger)\
**Post date:** [July 21, 2022, 6:30am UTC](https://forum.inductiveautomation.com/t/need-to-update-certain-tags-based-on-the-value-change-of-one-tag/62152/3 "2022-07-21T06:30:45Z")

</div>

![Untitled (2)](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/8/6846afa4f5308485eaa8dd47fa79016b714e4ccb.png)  
I don’t have the transaction groups module in my designer launcher as of now.  
Can we achieve the same with scripting? As in, on the value change of that can I do something with scripting to store them?

---

<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:** [July 21, 2022, 7:05am UTC](https://forum.inductiveautomation.com/t/need-to-update-certain-tags-based-on-the-value-change-of-one-tag/62152/4 "2022-07-21T07:05:40Z")

</div>

OK. Try [Gateway Event Scripts - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Gateway+Event+Scripts).  
Look at the tag change events in particular. Then you can add a script to that event. The events will run on the gateway even if no clients are open.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 21, 2022, 9:20am UTC](https://forum.inductiveautomation.com/t/need-to-update-certain-tags-based-on-the-value-change-of-one-tag/62152/5 "2022-07-21T09:20:14Z")

</div>

Specifically, look at  
`system.tag.readBlocking` to read your tag values. Note you can use relative referencing in tag change scripts if your tags to read are relative to your trigger tag with `system.tag.readBlocking(["[.]../folder 2/tag"])`  
`system.db.runPrepUpdate` or runNamedQuery to then write the values into a sql table. You can also use this to create the table if it doesn’t exist as well
