# Can I use System Tag in Gateway event script

**URL:** <https://forum.inductiveautomation.com/t/can-i-use-system-tag-in-gateway-event-script/60935>\
**Category:** Ignition\
**Tags:** ignition80, scripting\
**Created:** [June 19, 2022, 7:34pm UTC](https://forum.inductiveautomation.com/t/can-i-use-system-tag-in-gateway-event-script/60935 "2022-06-19T19:34:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefan.marcin74](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@stefan.marcin74](https://forum.inductiveautomation.com/u/stefan.marcin74)\
**Post date:** [June 19, 2022, 7:34pm UTC](https://forum.inductiveautomation.com/t/can-i-use-system-tag-in-gateway-event-script/60935/1 "2022-06-19T19:34:38Z")

</div>

Hello, I was wondering if I its possible to use system tag (current username logged into OS) in this Gateway event script and how. Thanks

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/b/4b7d4b37e1651b6ced3fced422a3f181a0e37ff7.png)

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [June 19, 2022, 7:47pm UTC](https://forum.inductiveautomation.com/t/can-i-use-system-tag-in-gateway-event-script/60935/2 "2022-06-19T19:47:34Z")

</div>

There is a system tag for a _client_ OS user, but not Gateway so far as I can see.

 ![os user](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/0/b0ba87f74f2a4304c9d4e9eaec60c198ab74e4cb.png)

Also, the general consensus is to avoid any time.sleep in any scripts.

---

<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:** [June 20, 2022, 11:08am UTC](https://forum.inductiveautomation.com/t/can-i-use-system-tag-in-gateway-event-script/60935/3 "2022-06-20T11:08:36Z")

</div>

No, the gateway runs separately. It does not have client-specific tags.

---

<div class="post-metadata">

**Author:** ![stefan.marcin74](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@stefan.marcin74](https://forum.inductiveautomation.com/u/stefan.marcin74)\
**Post date:** [June 20, 2022, 1:08pm UTC](https://forum.inductiveautomation.com/t/can-i-use-system-tag-in-gateway-event-script/60935/4 "2022-06-20T13:08:52Z")

</div>

thanks, but is there any other option to put there username of the machine ? E.g. I am using vpn to connect to ignition gw and as you can see on project update git commit should be executed. We want to put there username to commit message

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [June 20, 2022, 1:54pm UTC](https://forum.inductiveautomation.com/t/can-i-use-system-tag-in-gateway-event-script/60935/5 "2022-06-20T13:54:06Z")

</div>

```auto
import os
import pwd
values = pwd.getpwuid(os.getuid())[0]
print values
system.tag.writeBlocking(["[default]osUser"], values)

```

Note my Gateway is Linux. You will need to find a Windows equivalent if you are using that on your Gateway.

---

<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:** [June 20, 2022, 4:25pm UTC](https://forum.inductiveautomation.com/t/can-i-use-system-tag-in-gateway-event-script/60935/6 "2022-06-20T16:25:43Z")

</div>

And if two designers are running? Or no designers are running?

What you are trying to do is fundamentally flawed. There are efforts to support this from a java add-on module, IIRC, by hooking designer save operations.

---

<div class="post-metadata">

**Author:** ![stefan.marcin74](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@stefan.marcin74](https://forum.inductiveautomation.com/u/stefan.marcin74)\
**Post date:** [June 20, 2022, 7:36pm UTC](https://forum.inductiveautomation.com/t/can-i-use-system-tag-in-gateway-event-script/60935/7 "2022-06-20T19:36:46Z")

</div>

There must be always at least one designer running, because, obviously someone will work on some project, therefore he will update the project and gateway event will fire
