# 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:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dharani\_T](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@Dharani\_T](https://forum.inductiveautomation.com/u/Dharani_T)\
**Post date:** [December 8, 2022, 6:56am UTC](https://forum.inductiveautomation.com/t/automatic-navigation-after-5-seconds/67372/1 "2022-12-08T06:56:20Z")

</div>

Hi ,

I have a landing page while launch, i would like to navigate to another page after 5 seconds automatically. how to achieve this in perspective?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 8, 2022, 3:57pm UTC](https://forum.inductiveautomation.com/t/automatic-navigation-after-5-seconds/67372/2 "2022-12-08T15:57:59Z")

</div>

This thread seems similar:

> [@Change the text in a label on a time delay](https://forum.inductiveautomation.com/t/change-the-text-in-a-label-on-a-time-delay/63520):
>
> I have a label that has a text value of “READY TO SEND” It changes the value to “SENT” on a button press in the same view. How do I set a 5 second timer to change it back to “READY TO SEND”?? Edit: This is a perspective project. Sorry for the lack of detail, was writing this as I was walking out the door. I will give these a try on Monday. Thanks everyone for you input!

---

<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.
