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

Notifications

Announcements

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:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,073 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
    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
    153,073 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
    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
    153,073 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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard