# Update Query Tag on Execution of Transaction Group

**URL:** <https://forum.inductiveautomation.com/t/update-query-tag-on-execution-of-transaction-group/90256>\
**Category:** Ignition\
**Created:** [May 10, 2024, 9:06pm UTC](https://forum.inductiveautomation.com/t/update-query-tag-on-execution-of-transaction-group/90256 "2024-05-10T21:06:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pico\_Sankari](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@Pico\_Sankari](https://forum.inductiveautomation.com/u/Pico_Sankari)\
**Post date:** [May 10, 2024, 9:06pm UTC](https://forum.inductiveautomation.com/t/update-query-tag-on-execution-of-transaction-group/90256/1 "2024-05-10T21:06:49Z")

</div>

I have a transaction group that I need to write to a database when a value changes. At this time, I need to query this database and find a value from the most recent entry and then have part of my new entry use this value. Is it possible to have a query tag that reads a value from database when a transaction group is triggered, does some math with the queried value, and writes the new value as part of the entry made by the transaction group execution?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [May 10, 2024, 9:50pm UTC](https://forum.inductiveautomation.com/t/update-query-tag-on-execution-of-transaction-group/90256/2 "2024-05-10T21:50:04Z")

</div>

It looks like you can set up an expression item in a group that runs a query. You might be able to leverage this along with another expression tag to get the computed value you want.

 ![transactionSQL](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/5/254db9ba1391c80f4d6ccde1521d6df15f704d06.png)

---

<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 11, 2024, 8:55am UTC](https://forum.inductiveautomation.com/t/update-query-tag-on-execution-of-transaction-group/90256/3 "2024-05-11T08:55:34Z")

</div>

> [@Pico\_Sankari](#):
>
> Is it possible to have a query tag that reads a value from database when a transaction group is triggered, does some math with the queried value, and writes the new value as part of the entry made by the transaction group execution?

If you can do this calculation on data entry you could also do it on data retrieval and avoid the complexity of what you are trying to do here. I realise that there may be other reasons to do it your way. Explain the problem.
