# Gateway Tag Change Script - Write to Same Tag

**URL:** <https://forum.inductiveautomation.com/t/gateway-tag-change-script-write-to-same-tag/59613>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [May 16, 2022, 2:07pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-write-to-same-tag/59613 "2022-05-16T14:07:57Z")\
**Posts on this page:** 7\
**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:** [May 16, 2022, 2:07pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-write-to-same-tag/59613/1 "2022-05-16T14:07:58Z")

</div>

Will there be an issue (i.e. endless calls) to a gateway tag change script if the script itself updates the tag that it’s watching?

---

<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:** [May 16, 2022, 4:28pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-write-to-same-tag/59613/2 "2022-05-16T16:28:00Z")

</div>

Pretty sure that is a yes.

---

<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 16, 2022, 11:16pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-write-to-same-tag/59613/3 "2022-05-16T23:16:00Z")

</div>

Unless you put conditions in your change script to limit when it executes the body, e.g. exclude specific values from executing the body

---

<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:** [May 17, 2022, 1:10pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-write-to-same-tag/59613/4 "2022-05-17T13:10:22Z")

</div>

That’s what I’ve done. Thanks for verifying.

I have multiple clients that can change a gateway tag (via script on log in) I’m using to make sure an authorized user has logged in within a certain amount of time after a door opens. I needed a tag change script to change it back if one of the clients is still logged in when a different client logs out.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 17, 2022, 3:55pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-write-to-same-tag/59613/5 "2022-05-17T15:55:53Z")

</div>

If that’s session specific, it shouldn’t be a tag but a session property. You’re gonna run into issues (I believe you already have) if you try to handle things like this.

---

<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:** [May 17, 2022, 4:07pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-write-to-same-tag/59613/6 "2022-05-17T16:07:48Z")

</div>

Using vision, not perspective. Client tags are local to the clients, no?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 17, 2022, 4:14pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-write-to-same-tag/59613/7 "2022-05-17T16:14:18Z")

</div>

Yep, don’t mind me.
