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 / How to track user logo...
Power Apps
Unanswered

How to track user logout time in PowerApps Canvas App?

(0) ShareShare
ReportReport
Posted on by 30

How to track user logout time in PowerApps Canvas App without adding logout button.

Categories:
  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @nsmarathe ,

    If the user simply closes the browser tab (which I assume will be a lot of the time), there is no way of doing this - enforcing logout by a button / icon is the only way.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @nsmarathe ,

     

    Having a logout button will help.

    1. When all starts, then you can initiate a timer and when user click on logout, then you can track the start & logout time

     

    Let me know if this helps

    Thanks 😀

  • mmollet Profile Picture
    3,187 on at

    Do you have a reson that you or your users dont want to have to use a button? Maybe there is another outside of the box way to accomplish what you want.

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @Anonymous ,

    You do not need a timer - if you are writing a record to an audit file, you will have the Created date and time.

  • nsmarathe Profile Picture
    30 on at

    I cannot force users to click on logout button. Users can close the browser directly. So need some solution on it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The screen property OnHidden is triggered when closed, for single screen apps it would be as simple as: 

    Patch('Tracker', {timeLeft: Now()})

    For multi-screen apps you could either make a session ID and update the session's timeLeft every time the screen changes or:

    1. All navigation buttons set a 'leaving' variable to false

    2. All screens OnView change this variable to true

    Then if a user closes the powerapp, leaving will be true, as they are not navigating to a new page

    If(leaving = true,Patch('Tracker', {timeLeft: Now()}))

     

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @Anonymous ,

    That was buggy last time I looked at it (some time ago however) - a bit of testing - it seems to work OK

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Is the OnHidden trigger unreliable?

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard