# Popup onStartup script doesn't appear to run

**URL:** <https://forum.inductiveautomation.com/t/popup-onstartup-script-doesnt-appear-to-run/74047>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 22, 2023, 10:54pm UTC](https://forum.inductiveautomation.com/t/popup-onstartup-script-doesnt-appear-to-run/74047 "2023-05-22T22:54:01Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [May 22, 2023, 10:54pm UTC](https://forum.inductiveautomation.com/t/popup-onstartup-script-doesnt-appear-to-run/74047/1 "2023-05-22T22:54:01Z")

</div>

I have an onStartup script on the root of a popup's view. It is supposed to populate some text fields in the popup. It doesn't seem to run. I'm not getting anything in the logger / logger wrapper.

Am I missing anything here? Should the event fire on every occurance of the popup or only the first time?

---

<div class="post-metadata">

**Author:** ![amy.sudibyo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amy.sudibyo/32/38659_2.png) [@amy.sudibyo](https://forum.inductiveautomation.com/u/amy.sudibyo)\
**Post date:** [May 23, 2023, 12:22am UTC](https://forum.inductiveautomation.com/t/popup-onstartup-script-doesnt-appear-to-run/74047/2 "2023-05-23T00:22:00Z")

</div>

When you say your script is on the root of the view, do you mean it is an event on the root container? Have you tried put the script in an onStartup event on the view itself? It should work on the root container either way, but perhaps worth trying.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [May 23, 2023, 2:02am UTC](https://forum.inductiveautomation.com/t/popup-onstartup-script-doesnt-appear-to-run/74047/3 "2023-05-23T02:02:19Z")

</div>

I just tried out the onStartup Event of a `root` node and I found the expected behavior to be in place, printing content in the script as well as setting the values of props of Child components.

---

<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:** [May 23, 2023, 6:58pm UTC](https://forum.inductiveautomation.com/t/popup-onstartup-script-doesnt-appear-to-run/74047/4 "2023-05-23T18:58:18Z")

</div>

Thanks guys. The problem turned out to be an error in a runPrepUpdate query that was grabbing the data to populate the view. There was an error in the syntax and the script silently died every time. I've got it working.
