The Confirm Function in Power Apps Changes Everything
Have you ever needed a quick confirmation pop-up in your canvas app — and ended up spending half an hour layering rectangles, buttons, text labels, and variables just to fake it? Well, those days are officially over! 🎉
The new Confirm function in Power Apps lets you create an instant pop-up confirmation box with a single line of code. No more rectangles. No more variables or tedious workarounds. In this post and associated video, I’ll walk you through exactly how the Confirm function in Power Apps works, with several real-world examples you can copy into your own apps today.
🎬 What Is the Confirm Function in Power Apps?
The Confirm function in Power Apps is a brand new function that pops up a native confirmation dialog box right in your canvas app. It always gives the user two buttons to choose from — a confirm button and a cancel button — and you decide what happens when they click each one.
Here’s the basic idea: you put the function on a button, and when the user clicks that button, a dialog box appears asking them to confirm or cancel (or whatever you want the buttons to say). If they click confirm, you can run any Power Apps action you want — submit a form, delete a record, navigate to another screen, send an email, set a variable, or even do several of those things in a row.
In the past, building a pop-up like this was painful. You had to place a rectangle on the screen, layer little buttons on top of it, add text labels on top of those, and then wire up a variable to show or hide the whole thing based on what the user clicked. It took about half an hour every single time. The new Confirm function in Power Apps replaces all of that with one formula. 🙌
📋 The Four Things You Can Customize
Before we dig into the examples, let me show you the four optional parts you can include inside the Confirm function in Power Apps. Everything except the question itself is optional, but you’ll usually want to fill them all in for a polished look:
- Question — The main message that asks the user what they’re confirming.
- Title — A bold headline at the top of the dialog box.
- Subtitle — A smaller line under the title for extra context.
- ConfirmButton — The text on the “yes” button (defaults to “Confirm”).
- CancelButton — The text on the “no” button (defaults to “Cancel”).
Notice that the dialog will always have exactly two buttons. There is no way to hide the cancel button — but you can leave the cancel action empty, so clicking it just closes the dialog without doing anything. Also, if the user clicks anywhere outside the dialog, it closes the same way as clicking cancel.
✏️ Example 1: The Simplest Possible Confirm
Let’s start with the absolute simplest version of the Confirm function in Power Apps — wrapped inside an If statement so that something happens when the user clicks yes.
- Insert a button on your screen.
- Click on the button and go to the OnSelect property.
- Type the following formula:
If( Confirm("Are you sure?"), Notify("Thanks!"))
That’s it! When the user clicks the button, they’ll see a basic dialog that says “Are you sure?” with a default Confirm and Cancel button. If they click Confirm, the Notify function fires and shows a little message bar across the top of the screen.

The reason this works is that the Confirm function in Power Apps returns a true or false value depending on which button the user clicked. Confirm = true. Cancel = false. So when you wrap it inside an If statement, the “true” branch runs your action and the “false” branch does nothing (unless you tell it to).
🗑️ Example 2: A Practical Delete Confirmation
This is the most common reason I use the Confirm function in Power Apps — when somebody is about to delete a record and you want to double-check before it’s gone for good. Here’s how to add a delete button to a gallery row in a purchase request app.
- Inside your gallery template, insert a new button.
- Set the button’s Icon to the trash can and choose icon only so it just shows the icon.
- Set the button’s OnSelect to this formula:
If( Confirm( "Are you sure you want to delete?", { Title: "Delete this", Subtitle: "Delete " & ThisItem.Title, ConfirmButton: "Yes, delete", CancelButton: "No" } ), Remove('Purchase Requests', ThisItem))
Notice the cool part on the Subtitle line — I’m using ThisItem.Title to dynamically pull in the name of the record being deleted. So instead of a generic “Are you sure?”, the dialog actually says something like “Delete test 411.” This gives the user real confidence that they’re deleting the right thing. You can drop dynamic data like this into the question, the title, the subtitle, or the button text — anywhere you want.

💡 Pro tip: If you want to put each parameter on its own line for readability, click Format text
📝 Example 3: Confirm Before Submitting a Form
Another place for the Confirm function in Power Apps is on the submit button of a form. You want to make sure the user really meant to submit before the data goes anywhere.
- Click on your form’s Submit button.
- Set the OnSelect to:
If( Confirm( "Are you sure you want to submit this form?", { Title: "Submit form", ConfirmButton: "Yes, submit", CancelButton: "Cancel" } ), SubmitForm(frmPurchases))
Now here’s an important best practice: don’t put your success notification or your form reset inside this If statement. Why? Because if a required field is missing, the form won’t actually submit successfully — but your notification would still fire, telling the user “Thanks for submitting!” while they’re still staring at the form. Awkward. 😬
Instead, put your notify, reset, and navigate actions on the form’s OnSuccess property. That way, those actions only run if the form actually submitted without errors. Select the form control itself, choose the OnSuccess property, and put your follow-up actions there:
Notify("Thanks for submitting!");Navigate(scrHome)
This is the cleanest, most reliable pattern for combining the Confirm function in Power Apps with form submissions.
🎨 Example 4: Capturing the Answer in a Variable
Sometimes, instead of wrapping the Confirm function in Power Apps inside an If statement, you might want to store the user’s answer in a variable so you can use it elsewhere. Here’s how:
Set(varConfirmed, Confirm("Do you want to proceed with this operation?"))
When the user clicks the button, the dialog pops up with the default Confirm and Cancel buttons (since we didn’t customize them). After they click, varConfirmed will be set to either true or false. Then anywhere else in your app, you can check that variable and react accordingly:
If(varConfirmed, Notify("Processing your request..."), Notify("Operation cancelled."))
This pattern is helpful when you want the confirmation answer to be used later, on a different screen, or by multiple controls.
🌈 Example 5: Two Different Custom Buttons (Not Just Yes/No)
The two buttons in the Confirm function in Power Apps don’t have to be “Yes” and “No” — they can be any choice you want to give the user. For example, here’s a fun one that asks for a favorite color:
If( Confirm( "What is your favorite color?", { ConfirmButton: "Red", CancelButton: "Green" } ), Set(varFavoriteColor, "Red"), Set(varFavoriteColor, "Green"))
Notice that I’m using the third part of the If statement — the “else” — to capture what happens when the user clicks Cancel (which here says “Green”). By default, clicking the cancel button doesn’t take any action. But if you want it to do something, just add it as the third argument of your If statement.
🚀 Example 6: Doing Multiple Actions on Confirm
You can chain multiple actions together when the user clicks Confirm — just separate them with semicolons. Here’s an example that navigates the user to a welcome screen and shows a personalized notification:
If( Confirm( "Ready to head home?", { ConfirmButton: "Yes", CancelButton: "Cancel" } ), Navigate(scrWelcome); Notify("Thanks " & User().FullName & "!"))
This shows that the sky’s the limit. You can submit a form, navigate, send an email, patch a record, set variables — all from a single Confirm. 💪
🎯 Why the Confirm Function in Power Apps Is a Game Changer
If you’ve been building canvas apps for any length of time, you know how often you need a “Are you sure?” pop-up. Up until now, every single one of those pop-ups required you to hand-build the dialog from scratch with rectangles, buttons, text labels, and visibility variables. The new Confirm function in Power Apps replaces all of that with a single, native function.
Here are the highlights of why I love it:
- Saves massive time — what used to take 30 minutes now takes 30 seconds.
- Looks native — the dialog matches the Power Apps style automatically.
- Fully customizable text — title, subtitle, question, and both button labels.
- Supports dynamic data — pull in record names, user info, anything you want.
- Returns a boolean — easy to use inside If statements or to set a variable.
- Can chain multiple actions — use semicolons to do several things on confirm or cancel.
The most common use case in my experience is delete confirmations on a gallery row, but you’ll find yourself reaching for the Confirm function in Power Apps anytime you want a pop-up with two choices.
❓ FAQ
Q: Can I hide the cancel button on the Confirm function in Power Apps? No, the dialog always has exactly two buttons. However, you can leave the cancel action empty so clicking it does nothing — it just closes the dialog.
Q: Can I have more than two buttons in the Confirm dialog? No. The Confirm function in Power Apps is designed for two-choice scenarios only. If you need more than two options, you’ll need to build a custom dialog or use a different control like a dropdown.
Q: Does the Confirm function in Power Apps work in Power Apps for Teams? Yes! As long as you’re on a recent version of Power Apps Studio, the Confirm function in Power Apps is available across canvas apps, including those embedded in Teams.
Q: What does the Confirm function in Power Apps return? It returns a boolean value — true if the user clicks the confirm button, and false if they click the cancel button or click outside the dialog.
Q: Can I use dynamic data inside the dialog text? Absolutely. You can concatenate variables, record fields, user info, or any expression into the question, title, subtitle, or button labels using the & operator — just like the "Delete " & ThisItem.Title example earlier.
Resources
🔗 Here is Microsoft’s official reference page for the Confirm function in Power Apps.
👉 Want to learn more Power Apps tricks like this one? Check out my Power Apps training courses at iwmentor.com. Also, you get self-paced, on-demand training plus live Office Hours sessions where you can bring real-world questions when joining as an Ultimate member.
📺 Catch Power Hour live every Wednesday at 11 AM Central! Head over to the Power Hour community page to see the schedule and join the newsletter to vote on upcoming topics.
🎥 Subscribe to the WonderLaura YouTube channel so you don’t miss any of these demos!
🎓 New to Power Apps? Start with my free Power Apps introduction course.
Here is the associated video where I demonstrate all of the steps described above:
Definitely a game changer! Thanks Laura!