# Overriding Properties in UDT Instances by system.tag.writeAsync()

**URL:** <https://forum.inductiveautomation.com/t/overriding-properties-in-udt-instances-by-system-tag-writeasync/32516>\
**Category:** Ignition\
**Created:** [February 22, 2020, 10:20am UTC](https://forum.inductiveautomation.com/t/overriding-properties-in-udt-instances-by-system-tag-writeasync/32516 "2020-02-22T10:20:14Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [February 24, 2020, 6:03pm UTC](https://forum.inductiveautomation.com/t/overriding-properties-in-udt-instances-by-system-tag-writeasync/32516/20 "2020-02-24T18:03:40Z")

</div>

Here’s a function you can use instead of system.tag.writeAsync to override properties. It builds the structure in the second code block example in [earlier post above](http://forum.inductiveautomation.com/t/overriding-properties-in-udt-instances-by-system-tag-writeasync/32516/17?u=witman), and works for any nesting depth.

```python
# Override a property at variable nesting within a UDT.
# Provide basePath that UDT is in, and path to property from there.
# Property path must contain the property's tag name (i.e. "OVR.enabled", not "enabled").
def tagPropertyOverride(basePath, tagPropertyPath, overrideValue):
	names = tagPropertyPath.replace('.','/').split('/')
	# Cut property from names.
	overrideProperty = names.pop(len(names)-1)
	tags = None
	# Build structure from deepest nesting level up.
	for name in reversed(names):
		if tags is None:
			# This is the innermost level; include property override.
			tags = [{'name':name, overrideProperty:overrideValue}]
		else:
			# Nest last level inside this one and add name for this level.
			tags = [{'name':name, 'tags':tags}]
	# Merge this override with existing tag.
	system.tag.configure(basePath, tags, 'm')

tagPropertyOverride('[default]DPB', 'PI05051/CMD/OVR.enabled', False)

```

**EDIT** : For future readers, if you don’t need the ability to work to various nesting depths for a particular base path, see [this post](http://forum.inductiveautomation.com/t/modify-udt-member-tag-with-system-tag-configure/32311/8?u=witman) for a simpler solution (direct replacement for tag write) to override a property at a path.

---

_[View the full topic](https://forum.inductiveautomation.com/t/overriding-properties-in-udt-instances-by-system-tag-writeasync/32516)._
