{"id":40333,"date":"2021-07-20T00:00:31","date_gmt":"2021-07-20T07:00:31","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/premier-developer\/?p=40333"},"modified":"2021-08-03T12:00:53","modified_gmt":"2021-08-03T19:00:53","slug":"getting-started-with-gpt-3-in-power-platform","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/getting-started-with-gpt-3-in-power-platform\/","title":{"rendered":"Getting Started with GPT-3 in Power Platform"},"content":{"rendered":"<p><a href=\"https:\/\/www.linkedin.com\/in\/tnaveed\/\">Tahir Naveed<\/a> takes a look at generating Power Fx formulas through natural language with the help of GPT-3.<\/p>\n<hr \/>\n<p>When people need to create applications or business process, building those solutions can be time consuming and frustrating if they don&#8217;t have a specialized development skillset. This need gave the birth to <a href=\"https:\/\/powerplatform.microsoft.com\/en-us\/\">Power Platform<\/a>, where most app development can be done without writing any code. There are still scenarios, however, where users are required to write formulas in <a href=\"https:\/\/powerapps.microsoft.com\/en-us\/blog\/power-fx-coming-to-model-driven-power-apps-dataverse-and-more\/\"><strong>Power Fx<\/strong><\/a>. These formulas looks and feels like Excel formulas but are actually a low code programming language. Developers and formula writers still have to go through a learning curve with Power Fx which takes little bit of time.\u00a0 There is good news users who find themselves in this situation.<\/p>\n<p>Now you can write natural language to generate Power Fx formulas and use them to build your app in Power Platform.<\/p>\n<p>You read it right, you can use AI (NLP) to write code. Which means you can generate Power Fx formulas with the help of <a href=\"https:\/\/powerapps.microsoft.com\/en-us\/blog\/introducing-power-apps-ideas-ai-powered-assistance-now-helps-anyone-create-apps-using-natural-language\/\"><strong>GPT-3<\/strong><\/a> which is an advanced Natural Language AI model trained on 175 billion parameters that implements deep learning to be able to understand the natural language. GPT-3 is built by Elon Musk\u2019s <a href=\"https:\/\/openai.com\/\"><strong>OpenAI<\/strong><\/a> (an independent AI research &amp; development company) but runs on Microsoft Azure and powered by <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/machine-learning\/\">Azure Machine Learning<\/a>. This announcement came in Microsoft Build in May, 2021.<\/p>\n<h2>Getting started:<\/h2>\n<p>To get started with the GPT-3 you need following things:<\/p>\n<ol>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/power-platform\/admin\/preview-environments\">Preview Environment<\/a> in Power Platform.<\/li>\n<li>Sample Data. The data can be in Dataverse table but I will be using <a href=\"https:\/\/support.microsoft.com\/en-us\/office\/create-a-list-from-a-template-70b008a2-7a3d-4223-83d8-345e0313974d\">Issue Tracker<\/a> SharePoint Online list that comes with following sample data.\n<img decoding=\"async\" width=\"1278\" height=\"578\" class=\"wp-image-40334\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description.png\" alt=\"Graphical user interface, application Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description.png 1278w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-300x136.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-1024x463.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-768x347.png 768w\" sizes=\"(max-width: 1278px) 100vw, 1278px\" \/><\/li>\n<li>Create a canvas Power App in preview environment and <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/canvas-apps\/connections\/connection-sharepoint-online\">add connection<\/a> to the Issue tracker list.<\/li>\n<li>Add a <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/canvas-apps\/controls\/control-gallery\">gallery control<\/a> in the app and provide <strong>Issue tracker<\/strong> as data source. Your app should look as follows:\n<img decoding=\"async\" width=\"1906\" height=\"933\" class=\"wp-image-40335\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-text-application-descr.png\" alt=\"Graphical user interface, text, application Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-text-application-descr.png 1906w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-text-application-descr-300x147.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-text-application-descr-1024x501.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-text-application-descr-768x376.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-text-application-descr-1536x752.png 1536w\" sizes=\"(max-width: 1906px) 100vw, 1906px\" \/><\/li>\n<li>Select the gallery control and go to the <strong>ideas<\/strong> tab to provide instruction in natural language. These natural language instructions will be converted in to Power Fx formulas. Ideas tab will also suggest you some examples at the bottom e.g. Top 10 Issue tracker etc.\n<img decoding=\"async\" width=\"318\" height=\"629\" class=\"wp-image-40336\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/text-letter-description-automatically-generated.png\" alt=\"Text, letter Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/text-letter-description-automatically-generated.png 318w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/text-letter-description-automatically-generated-152x300.png 152w\" sizes=\"(max-width: 318px) 100vw, 318px\" \/><\/li>\n<li>Type the following instruction in the input box to see the data from issue tracker where ID is 1: <strong>Show record with ID 1<\/strong> and then click <strong>Get ideas<\/strong> to generate the perfect Power Fx formula. Then click on the formula to apply it to the gallery and you should see the record with ID=1.<img decoding=\"async\" width=\"1234\" height=\"584\" class=\"wp-image-40337\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-1.png\" alt=\"Graphical user interface, application Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-1.png 1234w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-1-300x142.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-1-1024x485.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-1-768x363.png 768w\" sizes=\"(max-width: 1234px) 100vw, 1234px\" \/><\/li>\n<\/ol>\n<p>What\u2019s happening is, the GPT-3 engine processes the query in natural language (Show record with ID 1) and figures out the data source name, columns name, values etc to generate a Power Fx formula that can be used in the gallery control.<\/p>\n<h2>Some Examples:<\/h2>\n<p>Note: <em>Make sure to select<\/em> <em>table, column and controls names from IntelliSense.<\/em><\/p>\n<ol>\n<li>Show records that have &#8220;fail&#8221; in the Title\n<img decoding=\"async\" width=\"1233\" height=\"588\" class=\"wp-image-40338\" style=\"font-size: 1rem;\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-2.png\" alt=\"Graphical user interface, application Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-2.png 1233w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-2-300x143.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-2-1024x488.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-2-768x366.png 768w\" sizes=\"(max-width: 1233px) 100vw, 1233px\" \/><\/li>\n<li>Show last 2 records from Issue tracker\n<img decoding=\"async\" width=\"1236\" height=\"586\" class=\"wp-image-40339\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-3.png\" alt=\"Graphical user interface, application Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-3.png 1236w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-3-300x142.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-3-1024x485.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-3-768x364.png 768w\" sizes=\"(max-width: 1236px) 100vw, 1236px\" \/><\/li>\n<li>Sort issue tracker by ID descending\n<img decoding=\"async\" width=\"1233\" height=\"586\" class=\"wp-image-40340\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-4.png\" alt=\"Graphical user interface, application Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-4.png 1233w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-4-300x143.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-4-1024x487.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2021\/07\/graphical-user-interface-application-description-4-768x365.png 768w\" sizes=\"(max-width: 1233px) 100vw, 1233px\" \/><\/li>\n<\/ol>\n<h3>Things to consider:<\/h3>\n<ul>\n<li>This functionality is meant to assist citizen\/pro developers with writing formulas faster.<\/li>\n<li>GPT-3 functionality is currently available in galleries and data tables in PowerApps and is optimized with <strong>Search()<\/strong>, <strong>Sort()<\/strong>, <strong>SortByColumns()<\/strong>, <strong>Filter()<\/strong>, <strong>FirstN()<\/strong> &amp; <strong>LastN()<\/strong> functions.<\/li>\n<li>An ideal natural language request to generate Power Fx formulas should be clear, simple and should contain tables and column names.<\/li>\n<li>IntelliSense is also there to help you complete typing the <a id=\"post-40333-_Hlk76059441\"><\/a>table, column and controls names to avoid any typos.<\/li>\n<li>This feature is available in North America and currently supports English only.<\/li>\n<\/ul>\n<p>Ref 1: <a href=\"https:\/\/blogs.microsoft.com\/ai\/from-conversation-to-code-microsoft-introduces-its-first-product-features-powered-by-gpt-3\/\">From conversation to code: Microsoft introduces its first product features powered by GPT-3 &#8211; The AI Blog<\/a><\/p>\n<p>Ref 2: <a href=\"https:\/\/powerapps.microsoft.com\/en-us\/blog\/introducing-power-apps-ideas-ai-powered-assistance-now-helps-anyone-create-apps-using-natural-language\/\">Introducing Power Apps Ideas: AI-powered assistance now helps anyone create apps using natural language | Microsoft Power Apps<\/a><\/p>\n<p>Ref 3: <a href=\"https:\/\/github.blog\/2021-06-29-introducing-github-copilot-ai-pair-programmer\/\">Introducing GitHub Copilot: your AI pair programmer | The GitHub Blog<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now you can write natural language to generate Power Fx formulas and use them to build your app in Power Platform.<\/p>\n","protected":false},"author":582,"featured_media":40350,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9923],"tags":[10619,10620,10203,10621],"class_list":["post-40333","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-power-platform","tag-gpt-3","tag-openai","tag-power-apps","tag-tahir-naveed"],"acf":[],"blog_post_summary":"<p>Now you can write natural language to generate Power Fx formulas and use them to build your app in Power Platform.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/40333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=40333"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/40333\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/40350"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=40333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=40333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=40333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}