# Include change from value in audit trail for tag writes

**URL:** <https://forum.inductiveautomation.com/t/include-change-from-value-in-audit-trail-for-tag-writes/114721>\
**Category:** Ignition\
**Tags:** perspective, ignition83, scripting\
**Created:** [March 27, 2026, 12:40pm UTC](https://forum.inductiveautomation.com/t/include-change-from-value-in-audit-trail-for-tag-writes/114721 "2026-03-27T12:40:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flying55](https://avatars.discourse-cdn.com/v4/letter/f/b19c9b/32.png) [@Flying55](https://forum.inductiveautomation.com/u/Flying55)\
**Post date:** [March 27, 2026, 12:40pm UTC](https://forum.inductiveautomation.com/t/include-change-from-value-in-audit-trail-for-tag-writes/114721/1 "2026-03-27T12:40:01Z")

</div>

We have enabled the audit log and would like to extend its functionality for tag writes.

When using `system.tag.writeBlocking` in Perspective, the audit trail records the new value along with the logged-in user who triggered the event. Ideally, we would also like to capture the previous value so we can see exactly what the value changed from. I assume there is no supported way to override the built-in audit logging behavior to achieve this.

As an alternative, for reference tags I could add a script that captures the old value when the tag changes and then writes a custom entry to the audit trail using `system.util.audit`. If I do that, is it possible to also identify which user triggered the change and include that into the log?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [March 27, 2026, 1:45pm UTC](https://forum.inductiveautomation.com/t/include-change-from-value-in-audit-trail-for-tag-writes/114721/2 "2026-03-27T13:45:28Z")

</div>

The `user`/`actor` is auto recorded as long as you don’t include that in your `system.util.audit`

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/a/3aa2c23dc24eecea7c6925c954f480432dbfc371.png)

This is true too for if a user does something that uses a binding to a tag, the user is recorded.

You could write your own `common.tag.writeBlocking` script in a module that does something like

```python
def writeBlocking(*args, **kwargs):
    # Since args[0] should be your list of tags
    tagPaths = args[0]
    curValues = system.tag.readBlocking(tagPaths)
    # Go through curValues and record to audit log
    for qV, tagPaths in zip(curValues, tagPaths):
        msg = "Tag Path {} had value {}".format(tagPath, qV.value)
        system.util.audit(msg)
    # Then write tag values which get audited automatically
    system.tag.writeBlocking(args, kwargs)

```

This would be audited with all previous values first and then what was written to in two separate blocks of rows in your audit db. I would not suggest doing one by one (ie read, write for the first tag, and then so on) as it will kill performance.

Unfortunatley don’t think this is going to be feasible for any bidirecitonal tag bindings on UI components.

---

<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:** [March 27, 2026, 1:47pm UTC](https://forum.inductiveautomation.com/t/include-change-from-value-in-audit-trail-for-tag-writes/114721/3 "2026-03-27T13:47:46Z")

</div>

You should just historize the tag.

---

<div class="post-metadata">

**Author:** ![Flying55](https://avatars.discourse-cdn.com/v4/letter/f/b19c9b/32.png) [@Flying55](https://forum.inductiveautomation.com/u/Flying55)\
**Post date:** [March 27, 2026, 2:35pm UTC](https://forum.inductiveautomation.com/t/include-change-from-value-in-audit-trail-for-tag-writes/114721/4 "2026-03-27T14:35:04Z")

</div>

Within perspective when i write to the tag it wont be a problem, then I can use system.util.audit and i think we’ll end up using that way.

But it would be handy to have the functionality directly on the tag by recording the way I would like to.

The reference tag have an event for value change, which would be fine to use except in that case I dont have any user information available it seems.

But the built in funcftionality with the audit trail do save with user, so maybe there was a way to get it.
