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 Automate / Get PowerApps Canvas A...
Power Automate
Unanswered

Get PowerApps Canvas App Session Information to Start and End a Flow

(0) ShareShare
ReportReport
Posted on by 11

Hello,

 

My team has built a Power Apps canvas app for reporting time. The dataset is a SharePoint list.

 

We want to to log all entries modified during a Power Apps session so that we can send a summary of the modifications by email.

 

I am wondering if it is possible to measure when a  Power Appssession is started and when it ends in Power Automate. Ideally, a flow starts once a user opens the app and ends when the user closes the app.

 

We do not want to add any button to start or end a session as this will affect the user experience and we cannot guarantee that a user would properly "end" a session with a button instead of closing the tab or the browser. 

 

Anyone know if this is possible or does anyone have a different approach?

Categories:
I have the same question (0)
  • RobElliott Profile Picture
    10,323 Super User 2025 Season 2 on at

    @marlson there are no triggers or actions related to when a Power Apps session starts or ends. I think what you'll need to do is to use a recurrence schedule trigger and set it to run every weekday or every 2 hours or whatever interval you select. You'd then add a compose action to get the time 2 hours ago and then a SharePoint get items action with a filter query set to Modifed ge '{outputs of the compose}' and Modified le '{expression utcNow()).

     

    recurrence.png

    You'd then probably want a Select action (not an apply to each), the a create html table action then a send an email action with the table in the body. That way only one email is sent instead of 1 email for each item modified.

     

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

  • Mitanshu Profile Picture
    1,650 Moderator on at

    Within your SharePoint List, you should create a text column for SessionID and each time something is modified from the App, you can update the SessionID text field.

     

    You can get SessionID as described under https://learn.microsoft.com/en-us/power-platform/power-fx/reference/object-host#sessionid-property

     

     

    Host.SessionID

     

     
    This way when you send out email notifications, you can make your Power Automate to send one email per SessionID

     

    Now, how to capture start and end time considering you may have parallel number of users and each session could be of varying length... 


    Start

    Your App has an OnStart property ... you can use that to store SessionID, User().Email and StartTime in a separate SharePoint List - SessionMater.

     

    End

    If your user is not doing an action - like clicking a button in the App, then it may not be possible to capture the End of the session. In such a situation, you have to make an assumption that each session ends after X hours, based on what your users are supposed to be doing in the App and how long it is typically going to take

     

    Power Automate Flow

    Using above approach, your trigger should be when a new item is created in SessionMaster

    Then you add a delay action for X hours

    Now you pull all records from main SharePoint List where SessionID = the row that was created in SessionMaster and triggered the Flow

    You send one email with information of all records from the main SharePoint List

     

    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 this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard