# Vision - Closing a single instance of multi-instance popup on all clients

**URL:** <https://forum.inductiveautomation.com/t/vision-closing-a-single-instance-of-multi-instance-popup-on-all-clients/51518>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [September 30, 2021, 8:11pm UTC](https://forum.inductiveautomation.com/t/vision-closing-a-single-instance-of-multi-instance-popup-on-all-clients/51518 "2021-09-30T20:11:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SMT](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@SMT](https://forum.inductiveautomation.com/u/SMT)\
**Post date:** [September 30, 2021, 8:11pm UTC](https://forum.inductiveautomation.com/t/vision-closing-a-single-instance-of-multi-instance-popup-on-all-clients/51518/1 "2021-09-30T20:11:53Z")

</div>

We have multiple instances of a popup that are displayed on the screen in set locations base on PLC tags. They are individually closed by the operator via a button script. The issue is that this only closes that one client’s popup and not the other open clients. We would like to have the ability to close a particular popup instance from all open clients via a PLC tag.

Here is the client TagCange script that launches the popups. Each channel has its own TagChange and location.

if newValue.value == 1:  
window = system.nav.openWindowInstance(‘Popup Windows/Close Handle Warning’,{‘ChannelNumber’:‘01’})  
window.setLocation(233,120)

Just not sure how to close individual ones now.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 30, 2021, 8:37pm UTC](https://forum.inductiveautomation.com/t/vision-closing-a-single-instance-of-multi-instance-popup-on-all-clients/51518/2 "2021-09-30T20:37:45Z")

</div>

Just do the opposite in a new tagchange script that monitors a new plc or internal tag value for change which is set by the close button on the popup, and instead close the popup with system.nav.closeWindow

---

<div class="post-metadata">

**Author:** ![SMT](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@SMT](https://forum.inductiveautomation.com/u/SMT)\
**Post date:** [September 30, 2021, 9:04pm UTC](https://forum.inductiveautomation.com/t/vision-closing-a-single-instance-of-multi-instance-popup-on-all-clients/51518/3 "2021-09-30T21:04:47Z")

</div>

I added the “if tag==0” condition. No luck.  
Although it compiled, I don’t think the code I have properly identifies the popup instance I want to close.

if newValue.value == 1:  
window = system.nav.openWindowInstance(‘Popup Windows/Close Handle Warning’,{‘ChannelNumber’:‘01’})  
window.setLocation(233,120)

if newValue.value == 0:  
window = system.gui.getWindow(‘Popup Windows/Close Handle Warning’,{‘ChannelNumber’:‘01’})  
system.nav.closeWindow(window)

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 30, 2021, 9:50pm UTC](https://forum.inductiveautomation.com/t/vision-closing-a-single-instance-of-multi-instance-popup-on-all-clients/51518/4 "2021-09-30T21:50:21Z")

</div>

You just need to use the window path:

```auto
   windowPath = 'Popup Windows/Close Handle Warning' 
   system.nav.closeWindow(windowPath) 
 

```

Otherwise, if you have multiple instances of the popup open and only want to close one of them (on all clients), then add a custom property to the popup which binds to your trigger tag, then use a property change script in the popup to close it (`system.nav.closeParentWindow(event`)) if the trigger turns off

---

<div class="post-metadata">

**Author:** ![Esmeralda\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@Esmeralda\_Lopez](https://forum.inductiveautomation.com/u/Esmeralda_Lopez)\
**Post date:** [September 26, 2022, 9:52pm UTC](https://forum.inductiveautomation.com/t/vision-closing-a-single-instance-of-multi-instance-popup-on-all-clients/51518/5 "2022-09-26T21:52:41Z")

</div>

mmmm how the trigger tag?
