# Best way to change 465 tag values at once

**URL:** <https://forum.inductiveautomation.com/t/best-way-to-change-465-tag-values-at-once/3211>\
**Category:** Ignition\
**Created:** [August 23, 2011, 3:19pm UTC](https://forum.inductiveautomation.com/t/best-way-to-change-465-tag-values-at-once/3211 "2011-08-23T15:19:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [August 23, 2011, 3:19pm UTC](https://forum.inductiveautomation.com/t/best-way-to-change-465-tag-values-at-once/3211/1 "2011-08-23T15:19:08Z")

</div>

I need to be able to swap 465 tag values between 1 and 3. whats the best way to go about doing something like that? each tag is in a different folder but has the same tag name. My thought was just to put it on a button but before I do anything I wanted to make sure there wasnt a better way, and also make sure that I would cause any issues by writing to so many tags at once.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [August 23, 2011, 4:11pm UTC](https://forum.inductiveautomation.com/t/best-way-to-change-465-tag-values-at-once/3211/2 "2011-08-23T16:11:04Z")

</div>

Right now it is easiest to perform these writes using the system.tag.writeToTag function in scripting. In Ignition 7.3 (coming out soon) we have a new function called system.tag.writeToTags which allows you to write to multiple tags in one call. That is important because right now each system.tag.writeToTag function can take up to 70 ms a piece if you are not using the tag in the client. In your case it could take 30 seconds or so to perform the writes.

You could use a transaction group to perform the writes but you will have a lot of items and expression items so it is not the best route.

Try it on a button and see what the results are. If they are really slow there are a few techniques to speed it up. You can also make the script shorter by doing the following:`folders = ["Folder1", "Folder2", "Folder3", ...]
valueToWrite = 1
for folder in folders:
    system.tag.writeToTag("%s/Value" % folder, valueToWrite)`That way you don’t have 465 system.tag.writeToTag lines. Let us know how this goes.

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [August 23, 2011, 5:34pm UTC](https://forum.inductiveautomation.com/t/best-way-to-change-465-tag-values-at-once/3211/3 "2011-08-23T17:34:08Z")

</div>

thanks I was going to do something similar.

are you gonna also do a system.getTag"s"Value in 7.3, to go along with the system.tag.writeToTags?

IMHO, that is going to make ignition very, very powerful.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 8, 2011, 6:27pm UTC](https://forum.inductiveautomation.com/t/best-way-to-change-465-tag-values-at-once/3211/4 "2011-09-08T18:27:32Z")

</div>

Yes, there is a  
[tt]system.tag.getTagValues([path1, path2, …])[/tt]  
and a  
[tt]system.tag.writeToTags([path1, path2, …], [value1, value2, …])[/tt]

and actually these are in 7.2.9.
