Most common scenarios are where you need users to be able to Exit the Canvas Power Apps in the below ways –
Scenario – Let’s say you put a close button somewhere in your App.
- Exit the current App but stay logged-in to Power Apps.
- Exist and Logout Power Apps entirely.
- In both above cases, ask user for confirmation before exiting.
So let’ look at these scenarios one by one –
Exit from current App
- Now, let’s say you’ve put a Close button on your App like this. And when you click it –
- It takes you to the App selection screen in your Power Apps
- You can implement this using Exit() method on OnSelect property of the Close button as shown below
And that’s it.
Exit and Logout of Power Apps
- Another variation to the same feature would be to Exit the App as well as Logging out completely. Now, I’ve put a Lock button here to represent Logout.
- You can implement this by using Exit(true) method as shown below
- And, it will logout the PowerApps Application itself.
And you’ll need to log in all over again.
Confirm before Exit
This is a feature that will work with both, Exit() and Exit(true). It will ask you for a confirmation on whether if you really like to close/logout the app?
- Select App in the left-hand Tree view, select App
- And look at the right hand Properties menu – The Confirm exit and Confirm exit message will let you enable this feature with the message you want to display –
And you can set your message - And then, when you either Logout or try to Close the App, you’ll be prompted with this message
Note: For all the changes to take place in Canvas Power App, make sure all changes are Published and you force close and re-open the Power App (if using on a mobile device / Tablet). Wait for a few seconds to get notified about the latest version being available.
And it’s all that simple! In case you are looking for more articles on Canvas Power Apps, you might want to check these below –
- Variables in Canvas Power Apps | Global and Context
- Get N:N records in a Canvas Power App using Common Data Service connector | Power Platform
- Adding a Canvas PowerApp to Teams
- Correctly connect to an Excel file in a Canvas PowerApp
- Sending Image from Canvas PowerApps to SharePoint Document Library using Flows
Hope this helps!
[…] Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App […]
LikeLike
[…] Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App […]
LikeLike
[…] Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App […]
LikeLike
[…] Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App | D365 Demystified — d365demystified.com Check how you can put exit, confirm before exit and logout features in your Canvas Power Apps. […]
LikeLike
Great but either Exit functions dont work for me on on select property.Do you know the reason?
Thanks.
LikeLike
Can you try on any other environments? Also, have you successfully Published the App and on phone, close the entire App and restart again. It’ll prompt you to download the latest version.
LikeLike
Thanks priyesh,it just worked as you said publish is the keyword to focus here.I republished and now it works. Most of the blogs are missing this last piece of puzzle.
LikeLike
Thanks Brijendra. I’ll update the same in my post too. However, it’s assumed for Power Platform developers / Dynamics CRM developers that every change need to have the App published to take effect.
LikeLiked by 1 person
I’ve updated the post accordingly – Added a Note at the end stating the same.
LikeLiked by 1 person
super thanks 🙂
LikeLike
Thank you for stopping by!
LikeLike
[…] Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App […]
LikeLike