# Update UDT Instance

**URL:** <https://forum.inductiveautomation.com/t/update-udt-instance/96088>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [September 17, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/update-udt-instance/96088 "2024-09-17T20:01:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [September 17, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/update-udt-instance/96088/1 "2024-09-17T20:01:21Z")

</div>

I have a UDT instance that I am using `system.tag.readBlocking()` to get the entire UDT's contents in JSON format.

How would I go about writing back to the UDT instance? Also, no all UDT members will be written to.

---

<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:** [September 17, 2024, 9:40pm UTC](https://forum.inductiveautomation.com/t/update-udt-instance/96088/2 "2024-09-17T21:40:37Z")

</div>

Reading in json format destroys some type info, and is therefore unlikely to suit for writeback. I suspect that the conversion to json is also a performance hit.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [September 17, 2024, 9:51pm UTC](https://forum.inductiveautomation.com/t/update-udt-instance/96088/3 "2024-09-17T21:51:47Z")

</div>

It may not be JSON format, I'm just reading with `system.tag.readBlocking()` at the UDT instance level (my JSON ignorance is showing).

Of course I can create the UDT member paths and still use a single `system.tag.writeBlocking()` call to update them all, but I thought this might be cleaner since I can read the entire UDT at once.

---

<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:** [September 18, 2024, 4:00am UTC](https://forum.inductiveautomation.com/t/update-udt-instance/96088/4 "2024-09-18T04:00:23Z")

</div>

Write blocking is the correct way, and obviously, it can and should be batched in one call.

It is possible to get the configuration of a tag, edit it, and alter the tag path to one level higher than the edited properties in order to write the new values back using [system.tag.configure](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-configure), but I only use this approach when I have to skirt around read only parameters that are set to `True`.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 18, 2024, 12:54pm UTC](https://forum.inductiveautomation.com/t/update-udt-instance/96088/5 "2024-09-18T12:54:08Z")

</div>

Writing _value_ props would only be conceivable using tag.configure if the tags are all memory tags, otherwise you'll be applying overrides to the value props that won't actually be used unless the tags are converted into memory; you'll also see the override icon appear.
