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 / Make action when user ...
Power Apps
Answered

Make action when user close navigator

(0) ShareShare
ReportReport
Posted on by 19

Hello community.

I am creating a system that creates invoices in powerapps. So, I need to know if Powerapps has any way to identify when the user closes the browser (that is, clicks on the X of the tab or of the browser).

My idea would be, if the user clicks on the X, then send an update to the SQL database.

 

Thank you

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

    Hi @Iep90 ,

    Unfortunately, power apps has no way of detecting when a user closes via the browser tab as it simply stops functioning.

     

    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.

    Visit my blog Practical Power Apps

  • Verified answer
    v-yujincui-msft Profile Picture
    Microsoft Employee on at

    Hi @Iep90 ,

     

    Do you want to save the user's logout time?

    I have an alternative that records the time less precisely.

    My idea is to create a record when the user starts the APP and then keep updating the current time every 30 seconds via Timer Control.

     

    I have made a simple test using SharePoint as the data source.

    1. Here is my list.

    vyujincuimsft_0-1650966219952.png

    2. Select the  APP and apply the following formula on its OnStart property as:

    Patch(datasource,Defaults(datasource),{UserName:User().FullName,Login:Now()})

    vyujincuimsft_1-1650966296779.png

    3. Select the Timer Control and apply the following formula on its OnTimerEnd property as:

    Patch(datasource,First(SortByColumns(Filter(datasource,UserName=User().FullName),"Created",Descending)),{Logout:Now()})

    vyujincuimsft_2-1650966656241.png

    Result Screenshot:

    vyujincuimsft_3-1650966908009.png

     

     

    Best Regards,

    Charlie Choi

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 226 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 191 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 167

Last 30 days Overall leaderboard