# How to Close a Perspective Popup Asynchronously After a Delay in Ignition?

**URL:** <https://forum.inductiveautomation.com/t/how-to-close-a-perspective-popup-asynchronously-after-a-delay-in-ignition/99869>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [December 16, 2024, 11:06am UTC](https://forum.inductiveautomation.com/t/how-to-close-a-perspective-popup-asynchronously-after-a-delay-in-ignition/99869 "2024-12-16T11:06:33Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 5, 2025, 5:07pm UTC](https://forum.inductiveautomation.com/t/how-to-close-a-perspective-popup-asynchronously-after-a-delay-in-ignition/99869/4 "2025-01-05T17:07:54Z")

</div>

- In Project Browser, select the root of your view.
- In Perspective Property Editor scroll down to CUSTOM.
- Create a new custom property `startTime`.
  - Create an expression binding on `startTime` with the expression, `now(0)`. This will fire once when the popup opens and save the current timestamp in the custom property.

- Create a second tag, `timeout`.
  - Add an expression binding,  
`(now(1000) - {this.custom.startTime}) > 5000`  
This will evaluate every 1000 ms and will return `true` when the popup has been open for 5000 ms.

- Right-click on `custom.timeout` and select Edit Change Script. Add the script,

```python
def valueChanged(self, previousValue, currentValue, origin, missedEvents):
	if currentValue.value:
		system.perspective.closePopup("")

```

Tips:  
`now(0)` → Runs once on load.  
`now()` → Runs at the default scan rate - typically 1000 ms.  
`now(4321)` → Runs every 4321 ms.

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-close-a-perspective-popup-asynchronously-after-a-delay-in-ignition/99869)._
