# Script running in script console but doesn't update when activating through tag

**URL:** <https://forum.inductiveautomation.com/t/script-running-in-script-console-but-doesnt-update-when-activating-through-tag/94905>\
**Category:** Ignition\
**Created:** [August 20, 2024, 7:07pm UTC](https://forum.inductiveautomation.com/t/script-running-in-script-console-but-doesnt-update-when-activating-through-tag/94905 "2024-08-20T19:07:39Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [August 20, 2024, 7:23pm UTC](https://forum.inductiveautomation.com/t/script-running-in-script-console-but-doesnt-update-when-activating-through-tag/94905/5 "2024-08-20T19:23:10Z")

</div>

Please reformat your post to have properly formatted code, whitespace is important in python. There is an edit icon you can click to edit your post.

> [@Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831):
>
> This thread is intended as a short help file for all those struggling to post formatted code on the forum. Code block formatting Posting formatted code on the forum (and most others) is as simple as selecting the code and pressing the \</\> button. It works the same as applying Bold or Italic styles to your document. It preserves indentation and applies syntax highlighting. [How to post code] Note that all the \</\> button does is add three backticks ``` on the line before the code block and anot…

Second, you are pulling data from the DB, this is absolutely not something to run in a tag change event. Configure this as a [Gateway Tag Change Event](https://www.docs.inductiveautomation.com/docs/8.1/platform/scripting/scripting-in-ignition/gateway-event-scripts#tag-change-scripts).

Third, consolidate your tag reads into a single `system.tag.readBlocking` call. Pull values from the response as needed later in the script.

---

_[View the full topic](https://forum.inductiveautomation.com/t/script-running-in-script-console-but-doesnt-update-when-activating-through-tag/94905)._
