Showing results for 
Search instead for 
Did you mean: 
Impactful Individual
Impactful Individual

How to fetch time when user has closed an app in PowerApps?



How to fetch time when user has closed an app in PowerApps?




Solution Sage
Solution Sage

Hi @dave8 

I don't think there really is a way to get the time someone closes the app. There is no function 'OnClose' or anything, because that would be really difficult. There are many way to close an app, it just wouldn't be very reliable.

A possibility however, although not a very clean one perse, is to use a timer and update every x seconds the current time to a datasource. That way when the app closes, you'll have the last updated time which would be rather close to the time closing the app, give or take a few seconds. Depends how precise you'll have to be and how frequently you'll then update the time.

If you were to start a timer when you start the app and loop it on 10s, you can put in the OnTimerEnd property the code to save the current time to whatever datasource you have. When the app closes, you'll have the closing time plus or minus 10s. Note that you'll have to update to your datasource, and just overwrite it with every update.


Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,263)