# Popup Close Button

**URL:** <https://forum.inductiveautomation.com/t/popup-close-button/71768>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [March 29, 2023, 12:47pm UTC](https://forum.inductiveautomation.com/t/popup-close-button/71768 "2023-03-29T12:47:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [March 29, 2023, 12:47pm UTC](https://forum.inductiveautomation.com/t/popup-close-button/71768/1 "2023-03-29T12:47:28Z")

</div>

Does anybody know how to create a "close" button on a popup screen to close itself in Perspective?  
I've tried "close popup" on click action, but it does not work. I wonder what I did wrong, or there is no way to create such button.  
There is always a close symbol at the to right corner to close the popup screen, but on Touch Screen, it is hard to close it. A button will be way easier for touch screen.  
Thanks

---

<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:** [March 29, 2023, 12:53pm UTC](https://forum.inductiveautomation.com/t/popup-close-button/71768/2 "2023-03-29T12:53:00Z")

</div>

Read the view's id and pass that to closePopup().

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [March 29, 2023, 1:31pm UTC](https://forum.inductiveautomation.com/t/popup-close-button/71768/3 "2023-03-29T13:31:06Z")

</div>

Can you give an script example of reading Popup ID and close this ID.  
Ignition website does not really have many samples. The syntax is so strange.

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [March 29, 2023, 2:12pm UTC](https://forum.inductiveautomation.com/t/popup-close-button/71768/4 "2023-03-29T14:12:57Z")

</div>

The first argument for system.perspective.openPopup is id. This is the id that should be passed to system.perspective.closePopup. If open popup is configured as a navigation option, the id is one of the configuration items.

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [March 29, 2023, 2:13pm UTC](https://forum.inductiveautomation.com/t/popup-close-button/71768/5 "2023-03-29T14:13:53Z")

</div>

Pass an identifier when you open the popup

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/3/93fafcdea062d310ad3e314e7bc01bc681e8f8a6.png)  
Use that same identifier on a script for your close button  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/1/f1330940d9d65b18b5a3a18bb08f3ee8a3173fed.png)

Using the pageID property also seems to work but i would't recommend it:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/f/3f7ce80e8cded30c0bb0c44c3be20a9c25f19200.png)

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [March 29, 2023, 2:18pm UTC](https://forum.inductiveautomation.com/t/popup-close-button/71768/6 "2023-03-29T14:18:47Z")

</div>

Thank you so much.  
It works.

---

<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:** [March 29, 2023, 2:42pm UTC](https://forum.inductiveautomation.com/t/popup-close-button/71768/7 "2023-03-29T14:42:53Z")

</div>

> [@leonardo.godoi](#):
>
> Using the pageID property also seems to work but i would't recommend it:

This will work as long as there is only ever 1 Popup opened on the page; once you have more than 1 Popup open it will only close the most recently interacted with Popup (highest z-index).

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [March 31, 2023, 1:06pm UTC](https://forum.inductiveautomation.com/t/popup-close-button/71768/8 "2023-03-31T13:06:55Z")

</div>

On my perspective project, after I used this method to close popup, there is only one popup can be opened; so it is good; it keeps the screen clean. The operator will have to close it before opening the next popup.
