# Show a popup in perspective on all clients if a value changes

**URL:** <https://forum.inductiveautomation.com/t/show-a-popup-in-perspective-on-all-clients-if-a-value-changes/61133>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 23, 2022, 7:25pm UTC](https://forum.inductiveautomation.com/t/show-a-popup-in-perspective-on-all-clients-if-a-value-changes/61133 "2022-06-23T19:25:11Z")\
**Posts on this page:** 1\
**Showing post:** 18

<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:** [June 27, 2022, 3:53pm UTC](https://forum.inductiveautomation.com/t/show-a-popup-in-perspective-on-all-clients-if-a-value-changes/61133/18 "2022-06-27T15:53:50Z")

</div>

When I run the following code:

```auto
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
	popupId = "O2Alarm"
	viewPath = "Split" # insert your view path here
	logger = system.util.getLogger("POPUP")
	sessions = system.perspective.getSessionInfo()
	for session in sessions:
		for pageId in session.pageIds:
			logger.info("{0} | {1}".format(session.id, pageId))
	
			if currentValue and currentValue.value: # I added an additional safety check for first time use here
				system.perspective.openPopup(popupId, viewPath, sessionId=session.id, pageId=pageId)
				logger.info("openPopup complete")
			else:
				# note no viewPath arg
				system.perspective.closePopup(popupId, sessionId=session.id, pageId=pageId)

```

I get the following logging:

```auto
POPUP	27Jun2022 08:49:51	B9B1743A | Split
POPUP	27Jun2022 08:49:51	openPopup complete
POPUP	27Jun2022 08:49:51	f456b99d-af9d-4410-94ce-39aec47272c8 | 32a9092e

```

Which tells me that

1. the first page found was a browser session
2. the popup function executed as expected (and I verified a Popup was open)
3. A designer “page” was found (note the 8-digit identifier in use for the sessionId and View name in use for the pageId).
4. The openPopup function did not complete the second time through because the session was a Designer.

---

_[View the full topic](https://forum.inductiveautomation.com/t/show-a-popup-in-perspective-on-all-clients-if-a-value-changes/61133)._
