{"id":43841,"date":"2026-02-27T16:41:33","date_gmt":"2026-02-27T11:11:33","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=43841"},"modified":"2026-02-27T17:10:40","modified_gmt":"2026-02-27T11:40:40","slug":"adding-native-confirmation-dialogs-with-power-fx-function","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2026\/02\/adding-native-confirmation-dialogs-with-power-fx-function\/","title":{"rendered":"Adding Native Confirmation Dialogs with Power Fx function"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignnone size-full wp-image-43846\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Adding-Native-Confirmation-Dialogs-with-Power-Fx-function.png\" alt=\"Native Confirmation Dialogs \" width=\"2100\" height=\"1200\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Adding-Native-Confirmation-Dialogs-with-Power-Fx-function.png 2100w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Adding-Native-Confirmation-Dialogs-with-Power-Fx-function-300x171.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Adding-Native-Confirmation-Dialogs-with-Power-Fx-function-1024x585.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Adding-Native-Confirmation-Dialogs-with-Power-Fx-function-768x439.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Adding-Native-Confirmation-Dialogs-with-Power-Fx-function-1536x878.png 1536w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Adding-Native-Confirmation-Dialogs-with-Power-Fx-function-2048x1170.png 2048w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Adding-Native-Confirmation-Dialogs-with-Power-Fx-function-660x377.png 660w\" sizes=\"(max-width: 2100px) 100vw, 2100px\" \/><\/p>\n<p>Before the built-in Confirm() function existed, adding a simple yes\/no confirmation in Power Apps required significant manual effort. In canvas apps, developers typically had to create overlay screens, place message text and action buttons, and manage visibility and state with variables and formulas, similar behavior often demanded custom JavaScript or other workaround techniques. These bespoke solutions increased development and maintenance overhead and resulted in inconsistent, hard-to-manage user experiences.<\/p>\n<p>Fortunately, the new Power Fx Confirm() function fixes this headache. It gives you a native, customizable confirmation dialog with one function call \u2013 no custom pop-up screens, no visibility toggles, and no extra JavaScript. Now you get a nice, built-in \u201cAre you sure?\u201d box that matches your app\u2019s design, so you don\u2019t have to build it yourself anymore.<\/p>\n<p>This blog focuses on practical use of the Confirm() function &#8211; prompting users to confirm important actions such as leaving a form with unsaved changes or performing irreversible operations. The function displays a confirmation message and waits for the user\u2019s response, returning a simple true or false value that can be used directly in Power Fx function. It also allows optional customization, such as setting a title( text which will be displayed as the dialog title ), subtitle( text which will be displayed as the dialog subtitle between the title and the message ), and meaningful button labels( ConfirmButton and CancelButton ), so the dialog clearly reflects the action being confirmed. This makes it easy to add clear, professional confirmation dialogs without building custom pop-ups or adding unnecessary complexity.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-43842\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs1.jpg\" alt=\"Adding Native Confirmation Dialogs with Power Fx function\" width=\"1918\" height=\"826\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs1.jpg 1918w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs1-300x129.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs1-1024x441.jpg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs1-768x331.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs1-1536x661.jpg 1536w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs1-660x284.jpg 660w\" sizes=\"(max-width: 1918px) 100vw, 1918px\" \/><\/p>\n<p>Set the button\u2019s OnSelect to use Confirm(). Select the Back button and open its OnSelect property. Enter a formula using the Confirm() function. Find attached code below:<\/p>\n<pre class=\"lang:css gutter:true start:1\">If(\r\n\r\n<strong><em>\u00a0\u00a0\u00a0 RecordForm.Unsaved,<\/em><\/strong>\r\n\r\n<strong><em>\u00a0\u00a0\u00a0 If(<\/em><\/strong>\r\n\r\n<strong><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Confirm(<\/em><\/strong>\r\n\r\n<strong><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"You have unsaved changes. Are you sure you want to go back ?\", \/\/ Message<\/em><\/strong>\r\n\r\n<strong><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 { <\/em><\/strong><strong><em>\/\/ OptionsRecord<\/em><\/strong>\r\n\r\n<strong><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Title: \"Unsaved Changes\", <\/em><\/strong><strong><em>\/\/ Title<\/em><\/strong>\r\n\r\n<strong><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ConfirmButton: \"Yes\", <\/em><\/strong><strong><em>\/\/ ConfirmButton<\/em><\/strong>\r\n\r\n<strong><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CancelButton: \"No\" <\/em><\/strong><strong><em>\/\/ CancelButton<\/em><\/strong>\r\n\r\n<strong><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/em><\/strong>\r\n\r\n<strong><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ),<\/em><\/strong>\r\n\r\n<strong><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Back()<\/em><\/strong>\r\n\r\n<strong><em>\u00a0\u00a0\u00a0 ),<\/em><\/strong>\r\n\r\n<strong><em>\u00a0\u00a0\u00a0 Back()<\/em><\/strong>\r\n\r\n<strong><em>)<\/em><\/strong><\/pre>\n<p>This means: when the button is clicked, Power Apps shows the confirmation dialog with your message. If the user clicks Yes\/Confirm, then the app executes Back() (navigating away). If the user clicks No\/Cancel, or when the user clicks outside the dialog box the app stays on the form.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-43843\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs2.jpg\" alt=\"Adding Native Confirmation Dialogs with Power Fx function\" width=\"1919\" height=\"826\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs2.jpg 1919w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs2-300x129.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs2-1024x441.jpg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs2-768x331.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs2-1536x661.jpg 1536w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs2-660x284.jpg 660w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/><\/p>\n<p>Example: The screenshot below shows the form after some edits (the Mobile Phone and Job Title fields have been changed). Now, when the user taps Back, the Confirm() dialog will appear:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-43844\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs3.jpg\" alt=\"Adding Native Confirmation Dialogs with Power Fx function\" width=\"1919\" height=\"828\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs3.jpg 1919w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs3-300x129.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs3-1024x442.jpg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs3-768x331.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs3-1536x663.jpg 1536w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs3-660x285.jpg 660w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/><\/p>\n<p>Confirm dialog appears on unsaved changes. After edits, click the Back button. You will see the built-in confirmation dialog (as below) with your message and two buttons. In our example it says \u201cYou have unsaved changes. Are you sure you want to go back?\u201d and shows Yes and No options. This dialog is automatically generated by Confirm()<\/p>\n<p>and matches the app\u2019s style. If the user taps Yes, the app goes back; if No, it stays on the form. The dialog\u2019s Title (\u201cUnsaved Changes\u201d) and button text can be customised via the options record<\/p>\n<p style=\"padding-left: 40px;\"><img decoding=\"async\" class=\"alignnone size-full wp-image-43845\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs4.jpg\" alt=\"Adding Native Confirmation Dialogs with Power Fx function\" width=\"624\" height=\"270\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs4.jpg 624w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/02\/Native-Confirmation-Dialogs4-300x130.jpg 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/p>\n<h3><strong>Conclusion<\/strong><\/h3>\n<p>Confirm () function removes the hassle of building and wiring custom pop-ups by returning a simple true\/false you can use directly in your app logic. It saves time, cuts complexity, and gives users a cleaner, consistent experience \u2014 try it out in your app today.<\/p>\n<h3><strong>FAQs <\/strong><\/h3>\n<h3><strong>1. Can I use the <\/strong><strong>Confirm()<\/strong><strong> function in both Canvas and Model-driven apps?<\/strong><\/h3>\n<p>Yes. One of the biggest advantages of Confirm() is its cross-platform compatibility. It works natively in <strong>Canvas apps<\/strong> and can also be used in <strong>Model-driven apps<\/strong> (within custom pages or command bar buttons using Power Fx).<\/p>\n<p><strong>2. Does <\/strong><strong>Confirm()<\/strong><strong> block the execution of the rest of my formula?<\/strong><\/p>\n<p>Yes. Unlike many other Power Fx functions, Confirm() is <strong>synchronous<\/strong> (suspending). The app will pause and wait for the user to select an option before moving to the next step in your If() or Chain formula.<\/p>\n<p><strong>3. Can I change the color or theme of the confirmation dialog?<\/strong><\/p>\n<p>No, the styling options are limited. You can customize the <strong>text<\/strong> (Title, Subtitle, and Button labels), but the visual design (colors, fonts, and rounding) is determined by the host player and the app&#8217;s overall theme to ensure a consistent OS\/Browser experience.<\/p>\n<p><strong>4. Is there a limit to how much text I can include in the dialog?<\/strong><\/p>\n<p>While there isn&#8217;t a strict character count, the dialog is designed for brevity. If your Subtitle or Message is too long, the dialog may scroll or truncate depending on the device screen size. It is best practice to keep messages concise.<\/p>\n<p><strong>5. What happens if the user clicks outside the dialog box?<\/strong><\/p>\n<p>By default, clicking outside the dialog or pressing the &#8220;Esc&#8221; key acts the same as clicking the <strong>CancelButton<\/strong>. The function will return false, and the subsequent logic (like Back() or Remove()) will not execute.<\/p>\n<p><strong>6. Can I add more than two buttons to the dialog?<\/strong><\/p>\n<p>No. The Confirm() function is strictly designed for binary choices (True\/False). If you need a multi-choice dialog (e.g., &#8220;Save,&#8221; &#8220;Don&#8217;t Save,&#8221; and &#8220;Cancel&#8221;), you will still need to build a <strong>custom collection-based pop-up<\/strong> or a separate screen.<\/p>\n<p><strong>7. Does <\/strong><strong>Confirm()<\/strong><strong> work in the Power Apps mobile app?<\/strong><\/p>\n<p>Absolutely. On mobile devices, the function triggers a native system-style alert, providing a much more &#8220;app-like&#8221; feel than a custom-built rectangle and label overlay.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before the built-in Confirm() function existed, adding a simple yes\/no confirmation in Power Apps required significant manual effort. In canvas apps, developers typically had to create overlay screens, place message text and action buttons, and manage visibility and state with variables and formulas, similar behavior often demanded custom JavaScript or other workaround techniques. These bespoke\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2026\/02\/adding-native-confirmation-dialogs-with-power-fx-function\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2355,2361],"tags":[3310],"class_list":["post-43841","post","type-post","status-publish","format-standard","hentry","category-powerfx","category-technical","tag-native-confirmation-dialogs"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/43841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=43841"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/43841\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=43841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=43841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=43841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}