# Automatic navigation after 5 seconds

**URL:** <https://forum.inductiveautomation.com/t/automatic-navigation-after-5-seconds/67372>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 8, 2022, 6:56am UTC](https://forum.inductiveautomation.com/t/automatic-navigation-after-5-seconds/67372 "2022-12-08T06:56:20Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [December 8, 2022, 5:23pm UTC](https://forum.inductiveautomation.com/t/automatic-navigation-after-5-seconds/67372/3 "2022-12-08T17:23:00Z")

</div>

I feel like the simplest solution that doesn't use `sleep` would be like [this solution](https://forum.inductiveautomation.com/t/change-the-text-in-a-label-on-a-time-delay/63520/14) from the thread @justinedwards.jle linked.

I wrote up a little example that adapts it to this use case.  
I set up two views, one as my landing page and one as the second page.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/1/b1ea17aa6021e573cb3ac2dd95c00573c0233b37.png)

On the landing page, in the root container, I set up some custom props, `redirect_timer` and `redirect_at`  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/c/bcdca2aabaee1bd87289672e1af60aa4e558e6dc.png)

The top prop, `redirect_timer`, is bound to the expression `now(1000)` to update once a second. If you want a more precise delay, you could change the `1000` to a smaller number.

I also set up an `onStartup` Script event action on the root container:

```auto
def runAction(self):
	self.custom.redirect_at = system.date.addSeconds(system.date.now(), 5)

```

This makes sure that as soon as the page loads, the target time is set up for 5 seconds from now.

In the meantime, the prop `redirect_timer` also has a change script on it:

```auto
def valueChanged(self, previousValue, currentValue, origin, missedEvents):
	if system.date.isAfter(currentValue.value, self.custom.redirect_at):
		system.perspective.navigate("/second-page")

```

This will call the navigate action once our current time has passed our target time.

---

_[View the full topic](https://forum.inductiveautomation.com/t/automatic-navigation-after-5-seconds/67372)._
