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 Apps / Warning Notification b...
Power Apps
Unanswered

Warning Notification before navigating to another screen

(0) ShareShare
ReportReport
Posted on by 149

Hi everyone

 

is there a possibility to display some kind of warning if a user wants to leave a screen and moves to another screen via button.

 

Like „Changes may get lost, do you want to continue“ and then chose „Yes“ or „No,stay“,

 

Thank you very much!

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Jasmin_Sch 

    Yes, you can pop up a message to tell the user this is about to happen. 

     

    Here are the steps.

    1) Put a rectangle on the screen and make it fill the entire screen.  Set the Fill property to RGBA(0,0,0,.53).

    This will block the entire screen when your pop up message is shown.  This is important as all the other controls on your screen would still be "active" when your pop up is shown.  This rectangle will block them from being pressed.

    Set the Visible property to lblPopup.Visible (this will show an error at this point and the rectangle will become invisible - don't worry about it, it will go away)

     

    2) Place a Label on the screen and set the Text to lclPopUp (this will show an error at this point, but don't worry about it, it will go away).  Make the label big and wide so that it looks like a box/window.  Set the Fill property to White.  And the BorderThickness to 2.  Set the Alignment to Center and the Vertical alignment to Top. Adjust the Top, Bottom, Left and Right padding to suit your needs.

    Set the Visible property of the label to !IsBlank(lclPopUp)  (again, this will show an error at this point and the label will disappear)

     

    3) Place Two buttons on the screen.  Set text of one to "Cancel" the other to "Leave".  Set the OnSelect property of the Cancel button to : UpdateContext({lclPopUp: Blank()})

    On the OnSelect property of the Leave button, set the following formula:  UpdateContext({lclPopUp: Blank()}); Back() (or Navigate(screenName) instead of Back() if you want to navigate some place)

    Set the Visible properties of both buttons to : labelNameMadeInStep2.Visible

     

    At this point, all the errors should be gone and the screen will have all of these controls invisible.

     

    NOW...in your app where ever you want to have this appear.  Simply use the following formula:

    UpdateContext({lclPopUp: "whatever message you want to display to the user"})

     

    Should give you what you need.

    I hope this is helpful for you.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard