# Tag Value Changed Script Doesn't Run When Value Source is Reference To Another Tag (8.1.17)

**URL:** <https://forum.inductiveautomation.com/t/tag-value-changed-script-doesnt-run-when-value-source-is-reference-to-another-tag-8-1-17/60650>\
**Category:** Ignition\
**Created:** [June 11, 2022, 10:07pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-doesnt-run-when-value-source-is-reference-to-another-tag-8-1-17/60650 "2022-06-11T22:07:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![edward.fowler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/edward.fowler/32/24179_2.png) [@edward.fowler](https://forum.inductiveautomation.com/u/edward.fowler)\
**Post date:** [June 11, 2022, 10:07pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-doesnt-run-when-value-source-is-reference-to-another-tag-8-1-17/60650/1 "2022-06-11T22:07:38Z")

</div>

I have a simple Memory tag, call it myMemTag. I has a simple value changed script that writes to another tag.

I have a simple Reference tag, call it myRefTag whose Value Source is myMemTag. The problem is the Value Changed script I have for myRefTag doesn’t execute. Is this by design…scripts on a Reference tag aren’t supposed to work?

Thanks,  
Ted.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 12, 2022, 7:25am UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-doesnt-run-when-value-source-is-reference-to-another-tag-8-1-17/60650/2 "2022-06-12T07:25:59Z")

</div>

Just to be clear, you have the scrips inside Gateway Event Scripts | Tag Change?

---

<div class="post-metadata">

**Author:** ![edward.fowler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/edward.fowler/32/24179_2.png) [@edward.fowler](https://forum.inductiveautomation.com/u/edward.fowler)\
**Post date:** [June 12, 2022, 9:29am UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-doesnt-run-when-value-source-is-reference-to-another-tag-8-1-17/60650/3 "2022-06-12T09:29:28Z")

</div>

No, not gateway, a Tag script.  
Doesn’t matter though, I found the problem…I had a lot of white space (empty lines) in the script and a lot of comments. I deleted all of it and it works now. Weird.  
@Transistor , thanks for asking.

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [July 5, 2023, 3:07pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-doesnt-run-when-value-source-is-reference-to-another-tag-8-1-17/60650/4 "2023-07-05T15:07:03Z")

</div>

Still odd and weird in 8.1.27. Doesn't like comments in certain places. Deleting descriptive comments seems to be the work around.

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [July 5, 2023, 3:13pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-doesnt-run-when-value-source-is-reference-to-another-tag-8-1-17/60650/5 "2023-07-05T15:13:46Z")

</div>

How did you define your comments?

```auto
# or """

```

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [July 5, 2023, 3:29pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-doesnt-run-when-value-source-is-reference-to-another-tag-8-1-17/60650/6 "2023-07-05T15:29:14Z")

</div>

Both produce the same result.
