web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Log out after 20 mins
Power Apps
Answered

Log out after 20 mins

(0) ShareShare
ReportReport
Posted on by 277

Hi 

I did a log in to user and now I want to know if it possible to have a system which log out people who used my app after 20 mins.

Can someone help me ? 

Thank you

Categories:
  • Verified answer
    enriqueglopez Profile Picture
    516 Moderator on at

    Store the Now() info when the user opens the app for the first time (in the App.OnStart() for example). In other place of your app, compare that variable with the current time with DateDiff:

     

    Set(Diff, DateDiff(Now(), YourOnStartVariable, TimeUnit.Minutes));

     

    Then, if your DIff is equal or greater than 20 use the Exit function.

     

    If(Diff >= 20, Exit(true))

     

    The parameter true in the Exit function logs out the current user.

     

    Ref: Exit function - Power Platform | Microsoft Learn

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard