{"id":39672,"date":"2024-11-13T15:43:33","date_gmt":"2024-11-13T10:13:33","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=39672"},"modified":"2024-11-14T17:32:46","modified_gmt":"2024-11-14T12:02:46","slug":"generating-power-fx-formulas-with-multi-language-comment-support-in-power-apps-using-copilot","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2024\/11\/generating-power-fx-formulas-with-multi-language-comment-support-in-power-apps-using-copilot\/","title":{"rendered":"Generating Power Fx Formulas with Multi-Language Comment Support  in Power Apps Using Copilot"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignnone size-full wp-image-39685\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/Power-Fx-Formulas.png\" alt=\"Power Fx Formulas\" width=\"1925\" height=\"1100\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/Power-Fx-Formulas.png 1925w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/Power-Fx-Formulas-300x171.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/Power-Fx-Formulas-1024x585.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/Power-Fx-Formulas-768x439.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/Power-Fx-Formulas-1536x878.png 1536w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/Power-Fx-Formulas-660x377.png 660w\" sizes=\"(max-width: 1925px) 100vw, 1925px\" \/><\/p>\n<p>The Comment-Generated Formulas feature in Power Apps lets you create Power Fx formulas directly from code comments. By typing `\/\/` or \u2018\/*\u2019 followed by a natural language instruction, Copilot can generate a relevant Power Fx formula tailored to your app\u2019s context. You can choose to accept Copilot\u2019s suggestion or edit the formula, using comments as convenient documentation for each formula.<\/p>\n<p>This tool is now available and supports multiple languages beyond English, making it accessible for users worldwide. Languages like French, Spanish, and German are now supported, allowing you to direct Copilot in your preferred language. To see the list of supported languages, refer to the official documentation on <a href=\"https:\/\/learn.microsoft.com\/en-us\/power-apps\/maker\/canvas-apps\/ai-formulas-formulabar#language-support\" target=\"_blank\" rel=\"noopener\">Supported Languages<\/a>.<\/p>\n<p><strong>Prerequisites<\/strong><\/p>\n<p>Copilot must be enabled in your environment. For additional guidance, refer to the documentation on <a href=\"https:\/\/learn.microsoft.com\/en-us\/power-apps\/maker\/canvas-apps\/ai-overview#disable-copilot-in-power-apps\" target=\"_blank\" rel=\"noopener\">how to enable or disable Copilot in Power Apps<\/a>.<\/p>\n<p>The new formula bar is enabled by default. If the Copilot menu isn\u2019t visible, review your app settings in <a href=\"https:\/\/make.powerapps.com\/\">Power Apps<\/a><a href=\"https:\/\/make.powerapps.com\/\" target=\"_blank\" rel=\"noopener\"> Studio<\/a>:<\/p>\n<ul>\n<li>In the command bar, go to Settings.<\/li>\n<li>Now navigate to Updates, and enable the option for Copilot comment-generated formulas.<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-39673\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/1Generating-Power-Fx-Formulas.jpg\" alt=\"Generating Power Fx Formulas\" width=\"1919\" height=\"876\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/1Generating-Power-Fx-Formulas.jpg 1919w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/1Generating-Power-Fx-Formulas-300x137.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/1Generating-Power-Fx-Formulas-1024x467.jpg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/1Generating-Power-Fx-Formulas-768x351.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/1Generating-Power-Fx-Formulas-1536x701.jpg 1536w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/1Generating-Power-Fx-Formulas-660x301.jpg 660w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/><\/p>\n<ul>\n<li>In the <strong>&#8220;Retired&#8221; <\/strong>tab, disable the toggle for <strong>&#8220;Legacy formula bar.&#8221;<\/strong><\/li>\n<\/ul>\n<p>With these settings, you\u2019ll be ready to take full advantage of Copilot&#8217;s AI-powered formula generation in Power Apps, simplifying formula creation with natural language.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-39677\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/2Generating-Power-Fx-Formulas-1.png\" alt=\"Generating Power Fx Formulas (1)\" width=\"1919\" height=\"873\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/2Generating-Power-Fx-Formulas-1.png 1919w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/2Generating-Power-Fx-Formulas-1-300x136.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/2Generating-Power-Fx-Formulas-1-1024x466.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/2Generating-Power-Fx-Formulas-1-768x349.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/2Generating-Power-Fx-Formulas-1-1536x699.png 1536w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/2Generating-Power-Fx-Formulas-1-660x300.png 660w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/><\/p>\n<h2><strong>Create Power Fx Formulas Instantly from Comments <\/strong><\/h2>\n<p>In Power Apps, Copilot allows you to generate Power Fx formulas directly from comments entered in the formula bar. Simply type a comment using <strong>`\/\/` or `\/*`,<\/strong> and Copilot will suggest a formula based on your comment.<\/p>\n<ol>\n<li>Open your Canvas app in edit mode.<\/li>\n<li>Type a comment in the formula bar by starting with <strong>`\/\/` or `\/*`.<\/strong><\/li>\n<\/ol>\n<p><strong><em>Example: \/\/ Calculate total expenses<\/em><\/strong><\/p>\n<ol start=\"3\">\n<li>Give Copilot a moment to suggest a formula, or press <strong>\u201cEnter\u201d<\/strong> to create it immediately.<\/li>\n<\/ol>\n<p>In the example below, I&#8217;ve created an expense calculator app in Power Apps and used a code comment to generate a formula to calculate pending expenses.<\/p>\n<p><strong>Example Code Comment:<\/strong><\/p>\n<p>\/\/ Concatenates a dollar sign with the formatted sum of costs from the LineItems2 table where the ReportID is found in the PendingReports table, but only if that sum is greater than zero; otherwise, it shows zero.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-39674\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/3Generating-Power-Fx-Formulas.jpg\" alt=\"Generating Power Fx Formulas\" width=\"1919\" height=\"872\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/3Generating-Power-Fx-Formulas.jpg 1919w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/3Generating-Power-Fx-Formulas-300x136.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/3Generating-Power-Fx-Formulas-1024x465.jpg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/3Generating-Power-Fx-Formulas-768x349.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/3Generating-Power-Fx-Formulas-1536x698.jpg 1536w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/3Generating-Power-Fx-Formulas-660x300.jpg 660w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/><\/p>\n<p><strong>AI-Generated Formula:<\/strong><\/p>\n<p>If(Sum(Filter(LineItems2, ReportID in ShowColumns(PendingReports, ID)), Cost) &gt; 0, &#8220;$&#8221; &amp; Text(Sum(Filter(LineItems2, ReportID in ShowColumns(PendingReports, ID)), Cost), &#8220;$#,##0.00&#8221;, &#8220;en-US&#8221;), &#8220;$0&#8221;)<\/p>\n<p>To use the suggested formula, press <strong>\u2018Tab\u2019<\/strong> to accept it. You can continue typing to adjust the formula as needed.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-39675\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/4Generating-Power-Fx-Formulas.jpg\" alt=\"Generating Power Fx Formulas\" width=\"1919\" height=\"874\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/4Generating-Power-Fx-Formulas.jpg 1919w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/4Generating-Power-Fx-Formulas-300x137.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/4Generating-Power-Fx-Formulas-1024x466.jpg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/4Generating-Power-Fx-Formulas-768x350.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/4Generating-Power-Fx-Formulas-1536x700.jpg 1536w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/4Generating-Power-Fx-Formulas-660x301.jpg 660w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/><\/p>\n<p>If Copilot doesn\u2019t offer a suggestion, it means it couldn\u2019t generate a formula based on your comment. Try rephrasing the comment to improve results. It\u2019s recommended to enclose elements you want to include in your formula in quotes, such as &#8220;PendingReports.ID&#8221; and \u201cLineItems2\u201d.<\/p>\n<h2><strong>Now Available with Multi-Language Support<\/strong><\/h2>\n<p>The Generating Power Fx formula using Copilot now supports multiple languages! To see the list of supported languages, refer to the official documentation on <a href=\"https:\/\/learn.microsoft.com\/en-us\/power-apps\/maker\/canvas-apps\/ai-formulas-formulabar#language-support\" target=\"_blank\" rel=\"noopener\">Supported Languages<\/a>.<\/p>\n<p>Let\u2019s try the example in Spanish:<\/p>\n<p><strong>Example Code Comment:<\/strong><\/p>\n<p>\/\/ Concatena un signo de d\u00f3lar con la suma formateada de costos de la tabla LineItems2 donde el ReportID se encuentra en la tabla PendingReports, pero solo si esa suma es mayor que cero; de lo contrario, muestra cero.<\/p>\n<p>By using this comment in Spanish, Copilot generated the same formula as in the original example.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-39676\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/5Generating-Power-Fx-Formulas.jpg\" alt=\"Generating Power Fx Formulas\" width=\"1919\" height=\"874\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/5Generating-Power-Fx-Formulas.jpg 1919w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/5Generating-Power-Fx-Formulas-300x137.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/5Generating-Power-Fx-Formulas-1024x466.jpg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/5Generating-Power-Fx-Formulas-768x350.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/5Generating-Power-Fx-Formulas-1536x700.jpg 1536w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2024\/11\/5Generating-Power-Fx-Formulas-660x301.jpg 660w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/><\/p>\n<h2><strong>Some limitations when generating formulas from code comments:<\/strong><\/h2>\n<ol>\n<li>It works only on the specific control and property you are focused on, and won&#8217;t modify other controls or properties to achieve the desired result.<\/li>\n<li>Copilot doesn\u2019t consider any existing formula text that is already present.<\/li>\n<li>It only recognizes the default properties in Power Apps, and are limited to supporting general Power Fx functions.<\/li>\n<li>User-defined functions are not recognized by Copilot.<\/li>\n<li>Functions specific to Power Apps, like `Navigate()`, aren\u2019t supported in code comments.<\/li>\n<li>The advanced panel doesn&#8217;t trigger formula suggestions.<\/li>\n<li>Copilot won\u2019t include existing formulas for the property in its suggestions.<\/li>\n<\/ol>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>Copilot in Power Apps makes creating Power Fx formulas easier than ever by generating them directly from comments. With multi-language support, users can now work in their preferred language, improving accessibility. This feature simplifies formula creation, enhances documentation, and speeds up app development. Enable Copilot in your environment and let it streamline your Power Apps experience.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/services\/\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"alignnone size-full wp-image-36891\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/12\/Microsoft-Power-Platform.gif\" alt=\"Microsoft Power Platform\" width=\"800\" height=\"200\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Comment-Generated Formulas feature in Power Apps lets you create Power Fx formulas directly from code comments. By typing `\/\/` or \u2018\/*\u2019 followed by a natural language instruction, Copilot can generate a relevant Power Fx formula tailored to your app\u2019s context. You can choose to accept Copilot\u2019s suggestion or edit the formula, using comments as\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2024\/11\/generating-power-fx-formulas-with-multi-language-comment-support-in-power-apps-using-copilot\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":11,"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":[2746,44],"tags":[2705,1337,2672],"class_list":["post-39672","post","type-post","status-publish","format-standard","hentry","category-copilot","category-power-apps","tag-copilot","tag-power-apps","tag-power-fx"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/39672","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\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=39672"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/39672\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=39672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=39672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=39672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}