A couple of weeks ago, Microsoft announced the availability of displaying dialog boxes using the Power Fx function for modern Commanding. This new functionality provides the ability to have your Modern commanding component library show custom dialog boxes that can be customized to your needs, and respond to user action with Power FX.
The Confirm Power Fx function basically displays a dialog box on top of the current screen with default OK and Cancel button which can be customized, and the ability to enter custom Title and Subtitle. The syntax of the confirm function is simple and only has two parameters, the message and an Options record which can be used to customize the title and the buttons.
The example below shows a simple confirmation dialog from Modern Commanding using PowerFx.
You can take a look at the code that makes up this dialog:
If(Confirm("Are you sure you want to delete this record?", {Title: "Delete Confirmation", ConfirmButton: "Of course", CancelButton: "Never"}), Notify("Item Removed",NotificationType.Information))
You can find out more information about the Confirm function in the Microsoft learn document below:
Confirm function in Power Apps – Power Platform | Microsoft Learn