# Binding History Enabled in UDT to another tag in UDT

**URL:** <https://forum.inductiveautomation.com/t/binding-history-enabled-in-udt-to-another-tag-in-udt/57730>\
**Category:** Ignition\
**Created:** [March 28, 2022, 6:33pm UTC](https://forum.inductiveautomation.com/t/binding-history-enabled-in-udt-to-another-tag-in-udt/57730 "2022-03-28T18:33:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyler.kamyszek](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@kyler.kamyszek](https://forum.inductiveautomation.com/u/kyler.kamyszek)\
**Post date:** [March 28, 2022, 6:33pm UTC](https://forum.inductiveautomation.com/t/binding-history-enabled-in-udt-to-another-tag-in-udt/57730/1 "2022-03-28T18:33:37Z")

</div>

I have a UDT with multiple tags that I’m recording. I would like to have these tags only recorded when a “Connected” tag is set to true inside of the UDT.

Can I bind the tag value within the UDT to the History Enable property of the tags I want to record history on?

tag(stringformat(’%s/Connected’, {PathToTag}[.])

Each instance of the UDT is for a different device that is connected at different points of our process. They are connected with a PLC in the middle, so ignition doesn’t connect to the devices directly. Otherwise I just wouldn’t record the bad statuses.

I would like to avoid having 100s of different Driven Scan Classes, one for each device.

My other idea is to just have a script record the data and avoid tag historian all together.

---

<div class="post-metadata">

**Author:** ![kvane](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kvane/32/22228_2.png) [@kvane](https://forum.inductiveautomation.com/u/kvane)\
**Post date:** [March 28, 2022, 6:38pm UTC](https://forum.inductiveautomation.com/t/binding-history-enabled-in-udt-to-another-tag-in-udt/57730/2 "2022-03-28T18:38:44Z")

</div>

Have you considered a triggered [transaction group](https://docs.inductiveautomation.com/display/DOC81/Understanding+Transaction+Groups) for this use case?

Transaction groups are often the ideal solution when the situation is similar to: “X data needs to be stored at rate Y when tag Z is true”

A triggered group would specifically only record data when a certain tag condition is met. For your case the trigger would be when the “Connected” tag is True.

---

<div class="post-metadata">

**Author:** ![kyler.kamyszek](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@kyler.kamyszek](https://forum.inductiveautomation.com/u/kyler.kamyszek)\
**Post date:** [March 28, 2022, 6:44pm UTC](https://forum.inductiveautomation.com/t/binding-history-enabled-in-udt-to-another-tag-in-udt/57730/3 "2022-03-28T18:44:29Z")

</div>

When the device is connected, I would like the value to continuously be recorded, which I guess I could do with enable/disable of the transaction group. I feel like then I’m choosing between 100s of transaction groups or scan groups.

I might be able to just do the tag history as ‘On Change’. They’re environmental sensors so they wouldn’t hold a value for very long.

---

<div class="post-metadata">

**Author:** ![kvane](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kvane/32/22228_2.png) [@kvane](https://forum.inductiveautomation.com/u/kvane)\
**Post date:** [March 28, 2022, 6:54pm UTC](https://forum.inductiveautomation.com/t/binding-history-enabled-in-udt-to-another-tag-in-udt/57730/4 "2022-03-28T18:54:29Z")

</div>

With a triggered transaction group the data storage would be driven by the device’s “connected” tag, but it would require making a different group for each device.

If the value of the tag will be consistently changing when the device is connected, then the ‘On Change’ history option should work.

---

<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 28, 2022, 6:58pm UTC](https://forum.inductiveautomation.com/t/binding-history-enabled-in-udt-to-another-tag-in-udt/57730/5 "2022-03-28T18:58:19Z")

</div>

Consider using an expression tag that forces bad quality when `Connected` is false. Then enable history on the expression instead of the base tag.
