How to set a time out condition for a screen?

Wayne shared this question 4 years ago
Answered

If a user navigates to a screen and then performs no actions for 3 seconds, I want it to go back to the screen they navigated from. Has anyone done this? Thanks.

Comments (3)

photo
1

Here's an idea:


I would create a variable to know if an action is performed or not during these 3 seconds. This variable would contain 'true' or 'false'. If an action is performed set it to 'true'.


Then I would create an 'onPageLoad' event for the desired screen with two interactions: the first interaction would be a 'Pause' action of 3 seconds. The second interaction will be a 'Link To back' navigation but with a condition. This condition should depend on the variable explained. If its false execute navigation.


The only bad thing about this solution is that you'll need to set the variable for every interaction in your screen...

photo
1

Thanks for your reply. I've tried a number of things and can't get it to work the way I want it to. To expand, when they enter the screen, and if they do nothing, I need to link them back to the last screen. But if they take an action, I need to "reset" the 3sec. timer and each time they take an action. Once they pause (are inactive) for 3 sec., I need to link them back to the last screen.


I've set a variable for every action including pageload and set it to true. If it is true, I link back to previous screen. So when an action is taken on screen, I set the variable to false, pause 3sec, then set it to true, but it executes the onPageload variable where it paused 3sec. on pageload and links, even though I'm setting it to false within each screen action. Does that make sense?

photo
1

Take a look at this example https://www.dropbox.com/s/51hmgwgg6bo...