How to Use the Confirm Function in Power Apps: A Complete Guide

By Dipak Shaw

February 14, 2026


App Development, App maker, Business apps, Canvas Apps, Citizen Developer, Confirm function, Confirmation dialog, Data validation, Dialog Box, Enterprise apps, Error prevention, Fluent design, Form validation, Low Code, Maker, Microsoft Power Platform, Modal dialog, Model-Driven Apps, Modern controls, No Code, Power Apps, Power Apps 2026, Power Apps best practices, Power Apps development, Power Apps formulas, Power Apps functions, Power Apps guide, Power Apps tips, Power Apps tutorial, Power Apps UI, Power Fx, Power Fx formulas, Power Platform, User Experience, UX design

One misclick. One deleted record. One frustrated user.

The Confirm function in Power Apps prevents exactly this scenario.

This simple yet powerful function displays a professional dialog box that asks users to confirm critical actions before proceeding. It’s easy to implement, fully customizable, and works in both canvas and model-driven apps.

In this guide, you’ll learn how to use the Confirm function to prevent accidental deletions, improve user confidence, and build more professional Power Apps—all in just a few minutes.

What Is the Confirm Function?

The Confirm function displays a dialog box on top of the current screen with two buttons: a confirm button and a cancel button. The user must choose one of the buttons before the dialog is dismissed.

In model-driven apps, the default buttons are localized versions of “OK” and “Cancel.”

In canvas apps (with modern controls enabled), the function uses the Fluent dialog and defaults to “Confirm” and “Cancel.”

The function returns:

  • true if the user selects the confirm button
  • false if the user selects the cancel button
  • blank (in canvas apps) if the user dismisses the dialog without selecting a button (e.g., pressing Esc or clicking outside the dialog)

Key Features

  • Modal behavior: The dialog blocks other interactions until the user responds.
  • Customizable: You can customize the title, subtitle, message, and button labels.
  • Localized: Default button labels are automatically localized based on the user’s language.
  • Simple return value: Returns a Boolean (true or false), making it easy to use in conditional logic.

Why the Confirm Function Matters

In enterprise apps, users often perform critical actions like:

  • Deleting records
  • Submitting forms
  • Approving requests
  • Resetting data

Without confirmation, a single misclick can lead to data loss, workflow disruption, or user frustration. The Confirm function adds a safety layer that:

  • Prevents accidental actions
  • Improves user confidence
  • Reduces support tickets
  • Enhances app professionalism

Real-Life Business Use Cases

1. HR Onboarding: Confirm Before Deleting a Candidate

An HR team uses a canvas app to manage candidate profiles. Before deleting a candidate record, the app prompts the user to confirm the action.

If(
    Confirm(
        "Are you sure you want to delete this candidate?",
        {
            Title: "Delete Candidate",
            Subtitle: "This action cannot be undone.",
            ConfirmButton: "Delete",
            CancelButton: "Cancel"
        }
    ),
    Remove(Candidates, Gallery1.Selected);
    Notify("Candidate deleted.", NotificationType.Success)
)

This prevents accidental deletions and gives the user a moment to reconsider.

2. IT Asset Management: Confirm Before Submitting a Request

An IT asset request app asks users to confirm before submitting a request for new hardware.

If(
    Confirm(
        "Do you want to submit this request?",
        { Title: "Submit Request" }
    ),
    SubmitForm(AssetRequestForm);
    Notify("Request submitted successfully.", NotificationType.Success)
)

This ensures users don’t accidentally submit incomplete or incorrect requests.

3. Expense Approval: Confirm Before Approving High-Value Expenses

A manager uses a model-driven app to approve expenses. For expenses over $5,000, the app displays a confirmation dialog.

If(
    ThisItem.Amount > 5000,
    If(
        Confirm(
            "This expense is over $5,000. Are you sure you want to approve it?",
            { Title: "High-Value Approval" }
        ),
        Patch(Expenses, ThisItem, { Status: "Approved" })
    ),
    Patch(Expenses, ThisItem, { Status: "Approved" })
)

This adds an extra layer of scrutiny for high-value transactions.

4. Document Management: Confirm Before Archiving Documents

A document management app asks users to confirm before archiving a document.

If(
    Confirm(
        "Are you sure you want to archive this document?",
        {
            Title: "Archive Document",
            ConfirmButton: "Archive",
            CancelButton: "Cancel"
        }
    ),
    Patch(Documents, Gallery1.Selected, { Status: "Archived" });
    Notify("Document archived.", NotificationType.Success)
)

This prevents users from accidentally archiving active documents.

How to Use the Confirm Function: Step-by-Step

Prerequisites

  • A Power Apps environment
  • Basic understanding of Power Fx formulas
  • For canvas apps: Modern controls must be enabled (otherwise, the native browser dialog appears)
  • For canvas apps: Power Apps authoring version 3.26022.5 or later

Step 1: Identify the Action That Needs Confirmation

Determine which user actions are critical or irreversible. Common examples:

  • Deleting records
  • Submitting forms
  • Approving/rejecting requests
  • Resetting data

Step 2: Add the Confirm Function to the Control

Open the control (e.g., a button) and add the Confirm function to the OnSelect property.

Basic syntax:

Confirm( "Your message here" )

Example:

If(
    Confirm("Are you sure?"),
    Remove(DataSource, ThisItem)
)

Step 3: Customize the Dialog (Optional)

Use the OptionsRecord parameter to customize the dialog.

Available options:

OptionsDescription
TitleThe text to display as the dialog title (larger, bolder font)
SubtitleThe text to display between the title and message
ConfirmButtonCustom text for the confirm button
CancelButtonCustom text for the cancel button

Example with customization:

If(
    Confirm(
        "Are you sure you want to delete this record?",
        {
            Title: "Delete Confirmation",
            Subtitle: "This action cannot be undone.",
            ConfirmButton: "Delete",
            CancelButton: "Cancel"
        }
    ),
    Remove(DataSource, ThisItem);
    Notify("Record deleted.", NotificationType.Success)
)

Step 4: Handle the Return Value

The Confirm function returns:

  • true if the user selects the confirm button
  • false if the user selects the cancel button
  • blank (in canvas apps) if the user dismisses the dialog

You can store the result in a variable for use in multiple operations:

Set(
    varConfirmed,
    Confirm("Do you want to proceed?")
);

If(
    varConfirmed,
    Notify("Processing...", NotificationType.Information);
    /* Additional operations */,
    Notify("Operation canceled.", NotificationType.Warning)
)

Step 5: Test the Dialog

  1. Save and publish your app.
  2. Test the action that triggers the Confirm function.
  3. Verify that the dialog appears with the correct message and buttons.
  4. Test both the confirm and cancel paths.
  5. Test dismissing the dialog (e.g., pressing Esc) to ensure the app handles it gracefully.

Limitations and Gotchas

1. Modern Controls Required (Canvas Apps)

In canvas apps, the Confirm function uses the Fluent dialog only if modern controls are enabled. If modern controls are not enabled, the native browser dialog appears, which may not support all customization options.

How to enable modern controls:

  • Go to Settings > Updates> New> Enable Modern controls and themes

2. Two Buttons Only

The Confirm function supports exactly two options: confirm and cancel. You cannot add a third button or more options.

Workaround: For scenarios requiring multiple choices, use a custom screen with multiple buttons or a dropdown control.

3. Cannot Hide the Cancel Button

The current design always shows both the confirm and cancel buttons. Users must have the ability to dismiss or cancel the dialog.

4. Modal Behavior

The Confirm function displays as a modal dialog that blocks other interactions until the user responds. This is by design, but it means users cannot interact with other parts of the app while the dialog is open.

5. Dismissal Behavior in Canvas Apps

In canvas apps, if the user dismisses the dialog without selecting a button (e.g., pressing Esc or clicking outside the dialog), the function returns blank. Make sure your logic handles this scenario.

Example:

If(
    Confirm("Are you sure?") = true,
    Remove(DataSource, ThisItem)
)

This ensures the removal only happens if the user explicitly selects the confirm button.

6. Localization

Default button labels are automatically localized based on the user’s language. If you provide custom button labels, you are responsible for localization.

Advanced Examples

Example 1: Confirm Before Saving a Form

// Save button OnSelect
If(
    Confirm(
        "Do you want to save these changes?",
        { Title: "Save Changes" }
    ),
    SubmitForm(EditForm1);
    ResetForm(EditForm1);
    Notify("Changes saved successfully.", NotificationType.Success)
)

Example 2: Confirm with Full Customization

If(
    Confirm(
        "This is the main message that describes what the user needs to confirm.",
        {
            Title: "Action Required",
            Subtitle: "Please choose one of the options below.",
            ConfirmButton: "Yes, proceed",
            CancelButton: "No, cancel"
        }
    ),
    Notify("User confirmed!", NotificationType.Success),
    Notify("User canceled.", NotificationType.Warning)
)

Example 3: Capture User Preference

Set(
    FavColor,
    If(
        Confirm(
            "What is your favorite color?",
            { ConfirmButton: "Red", CancelButton: "Green" }
        ),
        "Red",
        "Green"
    )
)

This uses custom button labels to capture a simple preference and stores the result in a global variable.

Example 4: Modal Message Without Checking Return Value

Confirm("There was a problem, please review your order.")

This displays a modal message that the user must acknowledge before continuing. The return value isn’t checked.

FeatureConfirmNotify
ModalYes (blocks interaction)No (non-modal banner)
User action requiredYes (must select a button)No (auto-dismisses)
Return valueBoolean (true/false)None
Use caseCritical actions requiring confirmationInformational messages

Use Confirm when:

  • The action is irreversible (e.g., delete, submit)
  • You need user confirmation before proceeding
  • You need to capture a Boolean decision

Use Notify when:

  • You want to display informational messages
  • The message doesn’t require user action
  • You want a non-intrusive notification

How to Try It Yourself

For Canvas Apps

  1. Open Power Apps Studio.
  2. Verify your authoring version: Go to Settings > Support > About and ensure you’re using version 3.26022.5 or later.
  3. Create a new canvas app or open an existing one.
  4. Enable modern controls: Settings > Updates > New> Enable Modern controls and themes.
  5. Add a button to your screen.
  6. Set the button’s OnSelect property to:
If(
    Confirm(
        "Are you sure you want to proceed?",
        {
            Title: "Confirmation",
            ConfirmButton: "Yes",
            CancelButton: "No"
        }
    ),
    Notify("You confirmed!", NotificationType.Success),
    Notify("You canceled.", NotificationType.Warning)
)
  1. Save and preview the app.
  2. Click the button and test the dialog.

Troubleshooting: If the Confirm function doesn’t work or shows a basic browser dialog, verify that:

  • Your authoring version is 3.26022.5 or later
  • Modern controls are enabled
  • You’re using the correct syntax

For Model-Driven Apps

  1. Open your model-driven app in the app designer.
  2. Navigate to the form or command bar where you want to add the confirmation.
  3. Add a custom button or command.
  4. In the command’s action, use the Confirm function:
If(  
    Confirm("Are you sure?", { Title: "Delete Confirmation" }),  
    Remove(ThisItem)  
)  
  1. Save and publish the app.
  2. Test the command to verify the dialog appears.

Best Practices

  1. Use clear, concise messages: Avoid jargon. Explain what will happen if the user confirms.
  2. Customize button labels: Use action-oriented labels like “Delete,” “Submit,” or “Approve” instead of generic “OK.”
  3. Add a title and subtitle: Provide context and clarity.
  4. Handle dismissal gracefully: In canvas apps, account for the blank return value.
  5. Don’t overuse: Only use Confirm for critical actions. Overusing it can frustrate users.
  6. Test localization: If your app supports multiple languages, test the default button labels in each language.
  7. Keep Power Apps Updated: Ensure you’re using Power Apps authoring version 3.26022.5 or later to access all Confirm function features and customization options.

Conclusion

The Confirm function is a simple yet powerful tool for building better user experiences in Power Apps. It adds a safety layer that prevents accidental actions, improves user confidence, and enhances app professionalism.

Whether you’re building a canvas app or a model-driven app, the Confirm function is easy to implement and highly customizable. Use it wisely, and your users will thank you.

Microsoft Learn URLs


Discover more from Power Solution

Subscribe to get the latest posts sent to your email.

Leave a Reply

Your email address will not be published. Required fields are marked

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

About the Author

A Consultant, Solution Architect & Full-Stack Developer on a mission to automate the boring, simplify the complex, and supercharge business with low-code, AI, and cloud innovation.

With 7+ years of experience, I specialize in building smart apps, AI-driven automation, and seamless cloud integrations using Power Apps, Power Automate, SharePoint, Dataverse, Microsoft 365, Azure, and Copilot Studio.

From workflow automation to digital transformation—I turn ideas into scalable, impactful solutions. 💡

Dipak Shaw

Discover more from Power Solution

Subscribe now to keep reading and get access to the full archive.

Continue reading