# Set one tag value to another tag's value on valueChanged event

**URL:** <https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [July 20, 2023, 8:35pm UTC](https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682 "2023-07-20T20:35:17Z")\
**Posts on this page:** 11\
**Page:** 2

<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:** [July 24, 2023, 8:07pm UTC](https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682/21 "2023-07-24T20:07:34Z")

</div>

> [@ian.sebryk](#):
>
> besides `time.time()`...

OMG! **NO!**

Avoid any python standard library imports where performance (and sometimes correctness) matters.

---

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [July 24, 2023, 8:12pm UTC](https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682/22 "2023-07-24T20:12:36Z")

</div>

@pturmel you're like the old school Santa that gives awesome presents when you're good and smack the 💩 out of you when you're not. 🙂 this is fantastic and is getting configured **today**. fortunately (?) we don't have many SQL calls, mostly to project tag datasets. so trimming those now has an added element of import. and not to be finicky or look a gift ship in the rockets, but do i need to import _all_ of `System` or will that have no real impact? i tend to trim my imports to just what i need and i don't know Java... 😛

EDIT: so leave Python imports out of performance-necessary scripts. gotcha.

---

<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:** [July 24, 2023, 8:17pm UTC](https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682/23 "2023-07-24T20:17:13Z")

</div>

> [@ian.sebryk](#):
>
> but do i need to import _all_ of `System` or will that have no real impact?

You cannot. You cannot use wildcard imports with java classes. You must import by class name. The import I suggested is one java class, not a package.

---

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [July 24, 2023, 8:41pm UTC](https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682/24 "2023-07-24T20:41:07Z")

</div>

oh, that's great. good to know. thank you.

---

<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:** [July 25, 2023, 8:22pm UTC](https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682/25 "2023-07-25T20:22:12Z")

</div>

Unless he meant

```auto
from java.lang.System import nanoTime

```

?

---

<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:** [July 25, 2023, 8:31pm UTC](https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682/26 "2023-07-25T20:31:15Z")

</div>

> [@nminchin](#):
>
> Unless

I don't think you can import a method. Have you tried that?

---

<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:** [July 25, 2023, 8:32pm UTC](https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682/27 "2023-07-25T20:32:05Z")

</div>

That's what I do. I rename it too... 😬 To simply `nt`

```auto
from java.lang.System import nanoTime as nt

```

I know that's probably naughty

---

<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:** [July 25, 2023, 8:33pm UTC](https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682/28 "2023-07-25T20:33:02Z")

</div>

Huh. Ok. 🤷‍♂️

> [@nminchin](#):
>
> naughty

🙄

{ The icon doesn't do justice to the eye roll you just produced. Bumped my pupils against the back of my skull. }

---

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [August 1, 2023, 5:28pm UTC](https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682/29 "2023-08-01T17:28:36Z")

</div>

you rolled your eyes so hard you saw your own brain. 😃

---

<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:** [August 1, 2023, 5:46pm UTC](https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682/30 "2023-08-01T17:46:17Z")

</div>

If he had imported it as `_0y`, my eyeballs would have exited their sockets to stare back at me. It's probably just as well that python doesn't permit identifiers that start with a digit.

---

<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:** [August 1, 2023, 7:19pm UTC](https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682/31 "2023-08-01T19:19:13Z")

</div>

It's like the Tardis inside. It may look like a standard sized brain from the outside, but on the inside, it's the size of the universe 🤯 (talking about Phil, of course)

[Previous page](https://forum.inductiveautomation.com/t/set-one-tag-value-to-another-tags-value-on-valuechanged-event/76682.md?page=1)
