# How to bring up another screen using value change in tag script

**URL:** <https://forum.inductiveautomation.com/t/how-to-bring-up-another-screen-using-value-change-in-tag-script/67020>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [November 29, 2022, 9:15am UTC](https://forum.inductiveautomation.com/t/how-to-bring-up-another-screen-using-value-change-in-tag-script/67020 "2022-11-29T09:15:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiyoung\_hwang](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jiyoung\_hwang](https://forum.inductiveautomation.com/u/jiyoung_hwang)\
**Post date:** [November 29, 2022, 9:15am UTC](https://forum.inductiveautomation.com/t/how-to-bring-up-another-screen-using-value-change-in-tag-script/67020/1 "2022-11-29T09:15:51Z")

</div>

I want to use a tag event to display another screen when the value exceeds that value, but it doesn't work.  
Help.

 ![tag1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/9/e9ac84879c94008c369d4d5c658f67f28ff0f348.gif)  
 ![tag2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/3/735ffb6334086c620c11c61e8c9441d58a1fc4ca.gif)  
 ![tag3](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/6/760bfc7e631f5ff44b7b8d9f70695690a72d289e.png)

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [November 29, 2022, 9:35am UTC](https://forum.inductiveautomation.com/t/how-to-bring-up-another-screen-using-value-change-in-tag-script/67020/2 "2022-11-29T09:35:31Z")

</div>

The error is pretty clear: You forgot the colon after your if condition.  
The two dots at the end of the line.  
`if currentValue.value > 10:`

---

<div class="post-metadata">

**Author:** ![jiyoung\_hwang](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jiyoung\_hwang](https://forum.inductiveautomation.com/u/jiyoung_hwang)\
**Post date:** [November 29, 2022, 9:39am UTC](https://forum.inductiveautomation.com/t/how-to-bring-up-another-screen-using-value-change-in-tag-script/67020/3 "2022-11-29T09:39:06Z")

</div>

I fixed it as you said and tried again, but I got the following error.

- Error executing script.  
Traceback (most recent call last):  
File "tagevent:valueChanged", line 3, in valueChanged  
at com.inductiveautomation.perspective.gateway.script.AbstractScriptingFunctions.getSession(AbstractScriptingFunctions.java:104)  
at com.inductiveautomation.perspective.gateway.script.AbstractScriptingFunctions.operateOnSession(AbstractScriptingFunctions.java:118)  
at com.inductiveautomation.perspective.gateway.script.AbstractScriptingFunctions.operateOnPage(AbstractScriptingFunctions.java:47)  
at com.inductiveautomation.perspective.gateway.script.PerspectiveScriptingFunctions.popupAction(PerspectiveScriptingFunctions.java:758)  
at com.inductiveautomation.perspective.gateway.script.PerspectiveScriptingFunctions.openPopup(PerspectiveScriptingFunctions.java:240)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
at java.base/java.lang.reflect.Method.invoke(Unknown Source)  
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: No perspective session attached to this thread.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [November 29, 2022, 9:42am UTC](https://forum.inductiveautomation.com/t/how-to-bring-up-another-screen-using-value-change-in-tag-script/67020/4 "2022-11-29T09:42:31Z")

</div>

> [@jiyoung\_hwang](#):
>
> No perspective session attached to this thread.

You're trying to do a perspective thing outside of the perspective's scope.

You can't open a popup directly from a gateway event.  
What you can do is send a message from that event, and catch it with something that's on all your perspective screens. In that handler, you'll be able to open a popup.

There may be better solutions to this.  
Maybe bind the tag to a session custom prop, and use that property to do things.

---

<div class="post-metadata">

**Author:** ![jiyoung\_hwang](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jiyoung\_hwang](https://forum.inductiveautomation.com/u/jiyoung_hwang)\
**Post date:** [November 29, 2022, 9:50am UTC](https://forum.inductiveautomation.com/t/how-to-bring-up-another-screen-using-value-change-in-tag-script/67020/5 "2022-11-29T09:50:22Z")

</div>

Uploading: TAG4.GIF...

Does the session customization you're referring to refer to the attachments?

It's my first time using ignition, so can you give me a simple example of how you said?

---

<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:** [November 29, 2022, 1:30pm UTC](https://forum.inductiveautomation.com/t/how-to-bring-up-another-screen-using-value-change-in-tag-script/67020/6 "2022-11-29T13:30:24Z")

</div>

> [@pascal.fragnoud](#):
>
> Maybe bind the tag to a session custom prop, and use that property to do things.

This.

Unlike a stand-alone HMI, there is separation in Ignition between gateway activities that are global and activities that are related to client user interfaces. Tags are global, and their scripts are isolated from User interfaces, and cannot **directly** affect them.

Instead, "pull" the tag into your user interface by binding it to a custom session, page, view, or component property (depending on the specificity you need for any resulting actions), then use an onChange action to run the script _ **in the UI** _.

---

<div class="post-metadata">

**Author:** ![jiyoung\_hwang](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jiyoung\_hwang](https://forum.inductiveautomation.com/u/jiyoung_hwang)\
**Post date:** [November 30, 2022, 12:00am UTC](https://forum.inductiveautomation.com/t/how-to-bring-up-another-screen-using-value-change-in-tag-script/67020/7 "2022-11-30T00:00:00Z")

</div>

You mean use "Session Events" for "Perspective"?

---

<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:** [November 30, 2022, 12:16am UTC](https://forum.inductiveautomation.com/t/how-to-bring-up-another-screen-using-value-change-in-tag-script/67020/8 "2022-11-30T00:16:25Z")

</div>

No, session custom properties. Create one. Bind the tag of interest to it. On the property, define an `valueChange` event.

Or, perhaps, use a custom property in a narrower scope.

[https://docs.inductiveautomation.com/display/DOC81/Perspective+Property+Change+Scripts](https://docs.inductiveautomation.com/display/DOC81/Perspective+Property+Change+Scripts)
