How to Use the New Confirm() Dialog Function in Power Apps

1. Introduction to the Confirm() Function in Power Apps

User confirmation is an essential part of every business application. Whether users are deleting records, discarding unsaved changes, or signing out of an application, providing a confirmation dialog helps prevent accidental actions and improves the overall user experience.

Power Apps now includes a built-in confirm() function that makes it easy to display modern confirmation dialogs without creating custom popups. Instead of building dialog boxes using containers, overlays, variables, and reusable components, makers can simply call the confirm() function to display a responsive modal dialog with Confirm and Cancel options.

The dialog appears on top of the current screen and requires the user to make a decision before continuing. Selecting Confirm returns true, while selecting Cancel or dismissing the dialog returns false. This makes it easy to control application logic using simple If() statements.

Since the dialog follows Power Apps’ Modern Controls and Themes, it provides a consistent look and feel across desktop, tablet, and mobile devices while reducing development time and maintenance.

 

2. Getting Started with the Confirm() Function

Before using the confirm() function, make sure Modern Controls and Themes are enabled in your application’s App Settings. Your app should also be running on a supported authoring version, which can be verified under Settings → Support, as the function is only available in newer Power Apps releases.

The simplest implementation requires only a message. Calling confirm("Your message") displays a confirmation dialog containing the message along with the default Confirm and Cancel buttons. Once the user makes a selection, the function immediately returns a Boolean value that can be used to determine the next action.

For a better user experience, the dialog can also be customized by providing additional options such as a Title, Subtitle, Confirm Button text, and Cancel Button text. This allows developers to create dialogs that clearly communicate the purpose of the action. For example, instead of displaying a generic Confirm button, you can rename it to Delete, Save, Sign Out, or any action-specific label, making the dialog more intuitive and reducing the chance of user mistakes.

In most scenarios, the confirm() function is wrapped inside an If() statement. If the function returns true, the requested action—such as deleting a record, navigating to another screen, or saving data—is executed. If it returns false, no action is performed, allowing users to safely cancel the operation without affecting application data. This simple approach replaces the need for manually built confirmation popups while keeping your application cleaner, more maintainable, and consistent.

3. Common Use Cases of the Confirm() Function

The confirm() function is designed for simple confirmation scenarios where users must explicitly approve an action before it is performed. One of its most common uses is record deletion. Instead of deleting an item immediately when the user clicks the Delete button, you can display a confirmation dialog asking whether they are sure they want to proceed. The record is removed only if the user selects Confirm, while selecting Cancel leaves the data unchanged. This simple confirmation step helps prevent accidental data loss and improves the overall user experience.

Another practical scenario is bulk deletion. When users select multiple records in a table, the dialog can display the number of selected items before performing the operation. This gives users a final opportunity to verify their action before multiple records are permanently removed, making bulk operations much safer.

The confirm() function is also valuable when working with forms. If a user edits a record but attempts to leave the screen without saving, Power Apps can check the form’s Unsaved property and display a confirmation dialog. Users can then choose whether to discard their unsaved changes or remain on the form and continue editing. This prevents users from unintentionally losing their work and creates a smoother experience for business applications.

Beyond delete operations, the function is equally useful for actions such as signing out, canceling business processes, approving requests, or confirming other important decisions where a simple Yes/No choice is required. Because the function returns a Boolean value, it integrates naturally with If() statements, making application logic both simple and easy to maintain.

4. Customizing and Implementing the Confirm() Dialog

One of the biggest advantages of the confirm() function is its flexibility. Besides displaying a message, developers can customize the dialog by adding a Title, Subtitle, and custom labels for both the Confirm and Cancel buttons. Using action-specific button names such as Delete, Save, Approve, or Sign Out makes the dialog clearer and reduces the possibility of user errors.

Since the function returns true or false, developers can either execute actions directly inside an If() statement or store the result in a variable for later use. Storing the user’s decision in a variable makes it possible to update other controls, trigger additional workflows, or modify the application’s interface based on the user’s choice.

Although the confirm() function replaces many traditional popup implementations, it is intended only for simple confirmation dialogs. It supports only two actions—Confirm and Cancel—making it ideal for consent-based workflows rather than complex data-entry scenarios. Applications that require multiple input fields, custom forms, or several action buttons should still use custom dialog components instead.

By using the built-in confirm() function, developers can eliminate the need to build custom popup containers, overlays, visibility variables, and reusable dialog components for standard confirmation workflows. This results in cleaner apps, less maintenance, a consistent user interface across all screens, and a faster development process while following Microsoft’s modern design standards.

5. Best Practices for Using the Confirm() Function in Power Apps

The confirm() function is most effective when used for actions that require user approval before execution. Common scenarios include deleting records, discarding unsaved changes, signing out of an application, or confirming critical business processes. Using the built-in confirmation dialog for these situations creates a consistent user experience across your application while eliminating the need to build custom popup components.

Always write clear and meaningful dialog messages that explain exactly what will happen if the user proceeds. Instead of using generic button labels like Confirm, customize the button text to match the action—for example, Delete, Save, Approve, or Sign Out. This provides better context and reduces the likelihood of accidental clicks, especially for irreversible actions.

Another recommended practice is to provide immediate feedback after the user confirms an action. Combining the confirm() function with Notify() allows users to instantly know whether an operation has been completed successfully. This creates a smoother and more professional user experience, particularly for actions such as deleting records or submitting forms.

Since the dialog is fully responsive, test its behavior across desktop, tablet, and mobile devices to ensure it displays correctly in every layout. Finally, remember that the confirm() function is intended only for simple Yes/No confirmation scenarios. If your application requires multiple user inputs, additional action buttons, or complex workflows, a custom dialog component remains the better solution. Following these best practices helps create cleaner, more consistent, and easier-to-maintain Power Apps while taking full advantage of Microsoft’s built-in modern dialog experience.

6. Conclusion

The introduction of the confirm() function significantly simplifies how developers implement confirmation dialogs in Power Apps. Instead of creating custom popups using containers, overlays, visibility variables, and reusable components, makers can now display a professional, responsive confirmation dialog with a single function call. This reduces development time while ensuring a consistent user experience across desktop, tablet, and mobile devices.

Whether you’re confirming record deletions, warning users about unsaved changes, handling bulk operations, or requesting approval before important actions, the confirm() function provides a clean and reliable solution. Its simple Boolean return value makes it easy to integrate with existing Power Apps formulas, allowing developers to build safer and more intuitive applications with minimal code.

By combining the confirm() function with Modern Controls, clear messaging, and user-friendly button labels, you can create applications that not only look professional but also help prevent accidental actions and improve overall usability. As Microsoft continues enhancing Power Apps, built-in features like confirm() demonstrate how modern development tools are making it easier than ever to build powerful, maintainable, and user-focused business applications.

Leave a Reply

you are successfully subscribed!

There was an error while trying to send your request. Please try again.

autopowerai.com will use the information you provide on this form to be in touch with you and to provide updates and marketing.