cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JakeKeisler
Level: Powered On

Is configuring an Idle Timeout or Inactivity Timeout possible in PowerApps?

I'm trying to have my PowerApp trigger the Exit() function if the device records no keystrokes, presses no buttons, etc after 10 minutes or so.

 

Is there any function or way to check for Inactivity or idle time?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Is configuring an Idle Timeout or Inactivity Timeout possible in PowerApps?

It's possible, but not a simple thing to do. There's no "global" event handler, so you'd need to, in every control that the user can interact with, update its OnSelect (or OnChange) property to update a "last activity time" with the value of Now(). You'd then need to have a timer that every minute checks the last activity time, compare it with the current time, and if this time is greater than 10 minutes, exit the app.


The timer properties would probably be along the lines of this:

Duration: 60000
Start: true
Repeat: true
OnTimerEnd: If(DateDiff(lastActivityTime, Now(), Minutes) > 10, Exit())

On each button, which will likely have some action on its OnSelect property, you'd need to update it to also update the last activity time:

OnSelect: Set(lastActivityTime, Now()); <previous OnSelect action>

Likewise, in all text inputs, you'd use its OnChange property to do the same:

OnChange: Set(lastActivityTime, Now())

In all other controls (slider, rating, listbox, anything where the user can interact), you'd need to have a similar action to update the last activity time.

 

So, while it's possible to do this scenario, it's a lot of work. If you feel that this should be supported natively, please consider creating a new feature request in the PowerApps Ideas page.

View solution in original post

2 REPLIES 2
Highlighted
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Is configuring an Idle Timeout or Inactivity Timeout possible in PowerApps?

It's possible, but not a simple thing to do. There's no "global" event handler, so you'd need to, in every control that the user can interact with, update its OnSelect (or OnChange) property to update a "last activity time" with the value of Now(). You'd then need to have a timer that every minute checks the last activity time, compare it with the current time, and if this time is greater than 10 minutes, exit the app.


The timer properties would probably be along the lines of this:

Duration: 60000
Start: true
Repeat: true
OnTimerEnd: If(DateDiff(lastActivityTime, Now(), Minutes) > 10, Exit())

On each button, which will likely have some action on its OnSelect property, you'd need to update it to also update the last activity time:

OnSelect: Set(lastActivityTime, Now()); <previous OnSelect action>

Likewise, in all text inputs, you'd use its OnChange property to do the same:

OnChange: Set(lastActivityTime, Now())

In all other controls (slider, rating, listbox, anything where the user can interact), you'd need to have a similar action to update the last activity time.

 

So, while it's possible to do this scenario, it's a lot of work. If you feel that this should be supported natively, please consider creating a new feature request in the PowerApps Ideas page.

View solution in original post

gog
Level: Powered On

Re: Is configuring an Idle Timeout or Inactivity Timeout possible in PowerApps?

Hi all, 

 

I am looking for exactly this feature.

Anyone tried it and it works? Is it difficult to get it working?
Please advice

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 398 members 2,950 guests
Please welcome our newest community members: