- Mayuresh Joshi
- Date Jan 27, 2022
While developing a canvas app many times we come across a scenario to create a popup message or an alert box. In this article, we will see how to create a popup confirmation message to delete an item from a gallery.
I have used a standard gallery with a delete button. When a user clicks on a delete button, an alert message should pop up asking for confirmation. If he clicks on "Yes" an item will be deleted and if he clicks on "No" the popup will be hidden and no action will be performed on that item.
Below is my typical horizontal gallery where you can see a delete button to delete the particular record:
To create a popup in PowerApps, we will use a group of controls likerectangles, labels, and buttons. We will set a visible property of this group with one variable. This will allow us to show and hide the popup based on variable value.
Step 1 -Set a variable named varShowPopup on click on the delete button
Step 2 -Add different controls to create a popup on the screen
Add a full-screen rectangle and change the color opacity to 0.5 as shown below. This will make the rectangle transparent.(Video) Dialog box in PowerApps | Pop up | Confirmation Box | Message Box | Window
Add another white color rectangle,labels for popup heading and message, close button,savebutton and make a group of these controls as shown below,
Set the visible property of this group to "varShowPopup". This is the same variable that we have initialized in Step 1.See AlsoWhat are the two ways to remove something from a list? how are they different? – techtipnowHow to Clear Your Android Cache & Why You Should Do ItC program to delete a file - GeeksforGeeksIn Unix, how do I remove a directory?(Video) Create Custom Dialog and Message Boxes in your Microsoft Power Apps
Set the variable to false, so that a popup will be hidden on the click on the close button.
Similarly for the delete button, write whatever formula you want to perform on click on the delete button, and at the last set varShowPopup variable to false so that the popup will be hidden. In this case, I am writing the remove function to delete the selected record and at the end, I am setting the variable to false.(Video) PowerApps are you sure popup | PowerApps popup message | powerapps tutorial | powerapps back button