# \[SOLVED\] Is there a way to set a variable OPC Server for a regular tag?

**URL:** <https://forum.inductiveautomation.com/t/solved-is-there-a-way-to-set-a-variable-opc-server-for-a-regular-tag/39540>\
**Category:** Ignition\
**Created:** [October 9, 2020, 3:05pm UTC](https://forum.inductiveautomation.com/t/solved-is-there-a-way-to-set-a-variable-opc-server-for-a-regular-tag/39540 "2020-10-09T15:05:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [October 9, 2020, 3:05pm UTC](https://forum.inductiveautomation.com/t/solved-is-there-a-way-to-set-a-variable-opc-server-for-a-regular-tag/39540/1 "2020-10-09T15:05:43Z")

</div>

Good morning,

I have an OPC tag (several hundred actually) and I’d like to change the OPC server path for all of them. From what I can see I can’t set the OPC Server to a variable though so i have to manually update every tag. I also have to update the OPC item path manually. All in all a big task. Is there an easier way?

See attached picture here:

 ![tagEditor](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/d/7ddd47ce7b43db2de019924e49874e0d1717838d.jpeg)

Thanks for any insight!

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [October 9, 2020, 3:13pm UTC](https://forum.inductiveautomation.com/t/solved-is-there-a-way-to-set-a-variable-opc-server-for-a-regular-tag/39540/2 "2020-10-09T15:13:50Z")

</div>

Are you doing it once or going to do it often in your program?

If its just once, you could export the tags to XML then do a find and replace to change your server path. Then reimport them.

If your doing it more than once you can use [system.tag.getConfiguration](https://docs.inductiveautomation.com/display/DOC80/system.tag.getConfiguration) and [system.tag.configure](https://docs.inductiveautomation.com/display/DOC80/system.tag.configure) to do it through scripting.

Another idea if your doing it often is to have the tags set up in UDT’s with a parameter setting your OPC Server. Then you could still use the system.tag.configure but you would just need to update the parameter.

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [October 9, 2020, 3:21pm UTC](https://forum.inductiveautomation.com/t/solved-is-there-a-way-to-set-a-variable-opc-server-for-a-regular-tag/39540/3 "2020-10-09T15:21:58Z")

</div>

I use Studio 5000 Logix Emulate to make programs in the office for projects and eventually have to connect to a PLC in the field. All the tags still exist but I have to change the paths at some point. And sometimes I do this in the opposite way. (Transfer a PLC project to my emulator.)

I was able to export a JSON file like you suggested and find/replace everything. It all seems to be working so thank you!
