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 Sign...
Power Apps
Suggested Answer

How to Track User Sign-In and Logout in Power Apps Canvas App?

(0) ShareShare
ReportReport
Posted on by

Hi everyone,

 

I have a Power Apps Canvas app and I want to track user sign-in and logout history.

 

I need to:

 

  •  

    Capture when a user opens the app


  •  

    Capture when a user logs out or exits


  •  

    Store user email and date/time in a data source (Dataverse or SharePoint)



  •  
 

Since Canvas apps don’t have a built-in logout or app close event:

 

  •  

    What is the recommended approach?


  •  

    Is using OnStart and a Logout button the best practice?



  •  
 

Any simple guidance or examples would be appreciated.

 

Thanks! 🙏

Categories:
I have the same question (0)
  • Suggested answer
    WarrenBelz Profile Picture
    155,463 Most Valuable Professional on at
    You would need to have a log file of some description with something like this (assuming SharePoint here) at App OnStart
    Patch(
       Logfile,
       Defaults(Logfile),
       {
          NameField: User().FullName,
          ActionField: "Logged in"
          TimeField: Now()
       }
    )
    You need three fields as above - 2 x Single Line of Text and 1 x Date/Time. You could actually rely on the Created field for the last one.
     
    For the log out, yes, a log-out button would be needed with the same code (except the Action), except there is always the danger of the user simply closing the tab and there is no workaround for this.
     
    Please ✅ Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  
  • WarrenBelz Profile Picture
    155,463 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    Please ✅ Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like â™¥
    Visit my blog
    Practical Power Apps    LinkedIn   

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 638

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard