Showing results for 
Search instead for 
Did you mean: 
Post Partisan
Post Partisan

Adding a prompt message when a button has been pressed

I just wanted to ask is there a way to add a prompt message/warning when a button button has been clicked. Well basically regrading the app created, after someone puts in their details and click on the back button by mistake what the button does right now is sends them back to the view page without saving their entry so I wanted to know if there was a way to add prompt message or pop up whichever one works best, whenever they click on the button a message shows up on the screen saying would you like to leave without saving and the option that say yes or no. When yes is clicked it takes them to the view page as the button initially does and when no is clicked it will remain on the edit page to click on the save icon that is located at the top of the page which will now save the entry. 

Super User III
Super User III


Yes, you can create a pop-up menu that looks like this.





Place this code in the OnSelect property of the back button to show the pop-up.



You would need to create it from scratch by placing several labels and buttons on the screen.  Then use this code in the Visible property of all the controls.




Then, you would place this code in the Yes button.



And this code goes in the no button.

Set(varShowPopUp, false)



If you'd like a full-tutorial on how to do it check out this article "How To Create A Pop-Up Menu In Power Apps".



Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users


We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (72,644)