# Copy tag values of UDT instance to another

**URL:** <https://forum.inductiveautomation.com/t/copy-tag-values-of-udt-instance-to-another/59974>\
**Category:** Ignition\
**Created:** [May 24, 2022, 6:29pm UTC](https://forum.inductiveautomation.com/t/copy-tag-values-of-udt-instance-to-another/59974 "2022-05-24T18:29:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![byutz](https://avatars.discourse-cdn.com/v4/letter/b/b38774/32.png) [@byutz](https://forum.inductiveautomation.com/u/byutz)\
**Post date:** [May 24, 2022, 6:29pm UTC](https://forum.inductiveautomation.com/t/copy-tag-values-of-udt-instance-to-another/59974/1 "2022-05-24T18:29:00Z")

</div>

Hello,

I have multiple tag instances of the same UDT that I have created, and I would like to copy all of the tag values(200 or so) from one instance to another. Is there any feature that exists in that can accomplish this? Or is there a way to have a script loop through all the tags contained in a UDT?

I have around 200 instances of my UDT and I want to be able to write the tag values of each into a holding UDT. I want to have a transaction group set up for my holding UDT so I can store the data from the one I am writing from in the database. Each of the instances are machine recipe parameters, and on good days, I want to store them as a reference. I thought this way sounded better than creating 200 transaction groups 🙂

Thanks!

---

<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:** [May 24, 2022, 6:34pm UTC](https://forum.inductiveautomation.com/t/copy-tag-values-of-udt-instance-to-another/59974/2 "2022-05-24T18:34:56Z")

</div>

You don’t need to use transaction groups (I’ve never used them tbh) , you could just script the sql insert into your database? Could trigger this on tag change script in your UDT or just via a button press action  
1% battery… Otherwise would reply more

---

<div class="post-metadata">

**Author:** ![byutz](https://avatars.discourse-cdn.com/v4/letter/b/b38774/32.png) [@byutz](https://forum.inductiveautomation.com/u/byutz)\
**Post date:** [May 24, 2022, 6:45pm UTC](https://forum.inductiveautomation.com/t/copy-tag-values-of-udt-instance-to-another/59974/3 "2022-05-24T18:45:18Z")

</div>

I wanted to use the transaction group because it does all the heavy lifting(creating a table with 200+ columns for each of the tags in my UDT). I am not opposed to using a sql insert script, but I would like a way to loop through all 200 tags in my UDT instead of tieing them line by line to the db columns. I can trigger this off a button press as I don’t want to create records of these recipes all the time, its more of a safety net and reference.

Is there a way to loop through all tags in a multi-folder udt?

Thanks!

---

<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:** [May 24, 2022, 7:18pm UTC](https://forum.inductiveautomation.com/t/copy-tag-values-of-udt-instance-to-another/59974/4 "2022-05-24T19:18:52Z")

</div>

You can use `system.tag.browse` to find all of your tags. This will also grab the current values of them as well. For subfolders also make sure to use recursive.  
Eg

```auto
udtTagPath = 'path/to/udtinst' 
tags = system.tag.browse(path=udtTagPath, filter={'recursive': True, 'tagType': 'AtomicTag'}) 
for tag in tags:
    print tag['fullPath'], tag['value'].value

```

---

<div class="post-metadata">

**Author:** ![byutz](https://avatars.discourse-cdn.com/v4/letter/b/b38774/32.png) [@byutz](https://forum.inductiveautomation.com/u/byutz)\
**Post date:** [May 24, 2022, 7:57pm UTC](https://forum.inductiveautomation.com/t/copy-tag-values-of-udt-instance-to-another/59974/5 "2022-05-24T19:57:40Z")

</div>

Thank you very much! I will give this a shot.
