# "No perspective page attached to this thread" when trying to openPopup from Session custom property change

**URL:** <https://forum.inductiveautomation.com/t/no-perspective-page-attached-to-this-thread-when-trying-to-openpopup-from-session-custom-property-change/36978>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [July 23, 2020, 4:39am UTC](https://forum.inductiveautomation.com/t/no-perspective-page-attached-to-this-thread-when-trying-to-openpopup-from-session-custom-property-change/36978 "2020-07-23T04:39:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [July 23, 2020, 5:55am UTC](https://forum.inductiveautomation.com/t/no-perspective-page-attached-to-this-thread-when-trying-to-openpopup-from-session-custom-property-change/36978/2 "2020-07-23T05:55:26Z")

</div>

For Perspective to open a Popup, it needs to know what Page to open the Popup on. In most places within Perspective, the triggers are from components, which by definition are already part of a Page. Session properties are NOT part of a page, and so even though they are part of a session, there is no direction as to which page they should open on.

That’s why your call is not working. The warning is telling you that the thread on the Gateway which is executing your script has no context as to which page it should open the Popup on. Suppose an active session has five tabs open when this script executes; which tab should the Popup open on?

Workarounds:

1. (recommended) I’m betting that you actually only want this Popup opened on a single one of your pages, so I would bind a custom property on the `root` of that View to the session property, and then place your change script on the custom root property instead of the session property. Doing this would result in the popup being opened just as if the change script had been on the session property, but now you will definitely have a Perspective page attached to the thread.

2. If you absolutely must use a session property to open a Popup, then you have access to the session through the supplied `self` argument. The following should get you what you need, although it will open a Popup on EVERY page in the session.

```auto
for pageId in self.info.pageIds:
    # note that the following call is actually supplying a pageId argument.
    system.perspective.openPopup(‘fgFgdI8a’, ‘Page/Popups/Recordatorios/TM_Remainder’, pageId=pageId)

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/no-perspective-page-attached-to-this-thread-when-trying-to-openpopup-from-session-custom-property-change/36978)._
