# UDT valuechanged script

**URL:** <https://forum.inductiveautomation.com/t/udt-valuechanged-script/82950>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [December 10, 2023, 10:34pm UTC](https://forum.inductiveautomation.com/t/udt-valuechanged-script/82950 "2023-12-10T22:34:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hfj](https://avatars.discourse-cdn.com/v4/letter/h/c4cdca/32.png) [@hfj](https://forum.inductiveautomation.com/u/hfj)\
**Post date:** [December 10, 2023, 10:34pm UTC](https://forum.inductiveautomation.com/t/udt-valuechanged-script/82950/1 "2023-12-10T22:34:55Z")

</div>

Hi,

I got a UDT with 3 tags.

1. Tag is a number
2. Tag is a string
3. Tag is a menory dataset. [0R x 1C]

When the number changes I want to add the 2. tags string value to 3. tags list. (insert new row)

I can't figure out how to write the valuechanged script on the number tag that will do this functionality

P.S: Basically I can't find the way to manipulate a dataset tag in the same UDT.

thanks Henrik.

---

<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:** [December 11, 2023, 1:10pm UTC](https://forum.inductiveautomation.com/t/udt-valuechanged-script/82950/3 "2023-12-11T13:10:16Z")

</div>

Your tag change script would use `system.tag.readBlocking()` to obtain the string tag and the current dataset value, then [system.dataset.addRow()](https://docs.inductiveautomation.com/display/DOC81/system.dataset.addRow), and then `system.tag.writeBlocking()` to apply the `addRow` return value back into the dataset tag.
