# Auto Data log into Database when value changed

**URL:** <https://forum.inductiveautomation.com/t/auto-data-log-into-database-when-value-changed/64933>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [October 7, 2022, 2:59am UTC](https://forum.inductiveautomation.com/t/auto-data-log-into-database-when-value-changed/64933 "2022-10-07T02:59:46Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alagumani\_Kaliyaperu](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Alagumani\_Kaliyaperu](https://forum.inductiveautomation.com/u/Alagumani_Kaliyaperu)\
**Post date:** [October 7, 2022, 2:59am UTC](https://forum.inductiveautomation.com/t/auto-data-log-into-database-when-value-changed/64933/1 "2022-10-07T02:59:46Z")

</div>

I want to log the machine setting data when ever the operator change the value, with Login username to know who changed the data. I have more then 50 settings data in my program but I just want to log the data which is changed. Kindly suggest me better way to make it done. Thanks.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [October 7, 2022, 4:32am UTC](https://forum.inductiveautomation.com/t/auto-data-log-into-database-when-value-changed/64933/2 "2022-10-07T04:32:54Z")

</div>

There are quite a few approaches that would be successful. In order to keep the project easy to support, I like the idea of creating a generic script in your project library that you can accept parameters such as machineID, setpoint, userID, location, etc. Then use those parameters in a query that inserts the information into your database with a timestamp.

Then simply call the generic script from either the input sources' action performed script or a client tag change event script. To ease implementation, and keep the project easier to support, I recommend all input sources that trigger such a script be set up as shared templates. This way, if you need to update, add, or remove parameters at some point in the future, it need only be done in one place.

---

<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:** [October 7, 2022, 12:28pm UTC](https://forum.inductiveautomation.com/t/auto-data-log-into-database-when-value-changed/64933/3 "2022-10-07T12:28:49Z")

</div>

Ignition has built-in auditing capabilities that will do this for you. Just turn it on.

---

<div class="post-metadata">

**Author:** ![Alagumani\_Kaliyaperu](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Alagumani\_Kaliyaperu](https://forum.inductiveautomation.com/u/Alagumani_Kaliyaperu)\
**Post date:** [October 13, 2022, 10:21am UTC](https://forum.inductiveautomation.com/t/auto-data-log-into-database-when-value-changed/64933/4 "2022-10-13T10:21:39Z")

</div>

Thanks for your replay actually i want to create a separate table for my settings.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [October 13, 2022, 12:50pm UTC](https://forum.inductiveautomation.com/t/auto-data-log-into-database-when-value-changed/64933/5 "2022-10-13T12:50:56Z")

</div>

you could perhaps use transaction groups to log changes of such tag to database.

---

<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:** [October 13, 2022, 1:12pm UTC](https://forum.inductiveautomation.com/t/auto-data-log-into-database-when-value-changed/64933/6 "2022-10-13T13:12:03Z")

</div>

> [@prafull\_j](#):
>
> use transaction groups

The OP wants to capture when _ **users** _ change values. Only the audit subsystem will do that.

---

<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:** [October 13, 2022, 1:13pm UTC](https://forum.inductiveautomation.com/t/auto-data-log-into-database-when-value-changed/64933/7 "2022-10-13T13:13:31Z")

</div>

> [@Alagumani\_Kaliyaperu](#):
>
> i want to create a separate table

Only Ignition's audit subsystem will capture user inputs. Consider adding triggers to your database to catch audit entries and move/insert them to your desired tables.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [October 13, 2022, 1:22pm UTC](https://forum.inductiveautomation.com/t/auto-data-log-into-database-when-value-changed/64933/8 "2022-10-13T13:22:25Z")

</div>

Oh I missed that point I thought operators changing setpoint from machine panels which would perhaps be OPC items.

Can tag change scripts not be used to write to DB if its user inputs from clients in that case?

---

<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:** [October 13, 2022, 1:26pm UTC](https://forum.inductiveautomation.com/t/auto-data-log-into-database-when-value-changed/64933/9 "2022-10-13T13:26:03Z")

</div>

The tag change scripts will fire, but will also fire if the value changes from elsewhere. The tag change script will also **not** have access to the user identity.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [October 13, 2022, 1:37pm UTC](https://forum.inductiveautomation.com/t/auto-data-log-into-database-when-value-changed/64933/10 "2022-10-13T13:37:35Z")

</div>

Valid point I missed.

---

<div class="post-metadata">

**Author:** ![Alagumani\_Kaliyaperu](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Alagumani\_Kaliyaperu](https://forum.inductiveautomation.com/u/Alagumani_Kaliyaperu)\
**Post date:** [October 14, 2022, 1:24am UTC](https://forum.inductiveautomation.com/t/auto-data-log-into-database-when-value-changed/64933/11 "2022-10-14T01:24:27Z")

</div>

Thank you all for your reply
