Getting Started with GPT-3 in Power Platform

Developer

Tahir Naveed takes a look at generating Power Fx formulas through natural language with the help of GPT-3.


When people need to create applications or business process, building those solutions can be time consuming and frustrating if they don’t have a specialized development skillset. This need gave the birth to Power Platform, where most app development can be done without writing any code. There are still scenarios, however, where users are required to write formulas in Power Fx. 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.  There is good news users who find themselves in this situation.

Now you can write natural language to generate Power Fx formulas and use them to build your app in Power Platform.

You read it right, you can use AI (NLP) to write code. Which means you can generate Power Fx formulas with the help of GPT-3 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’s OpenAI (an independent AI research & development company) but runs on Microsoft Azure and powered by Azure Machine Learning. This announcement came in Microsoft Build in May, 2021.

Getting started:

To get started with the GPT-3 you need following things:

  1. Preview Environment in Power Platform.
  2. Sample Data. The data can be in Dataverse table but I will be using Issue Tracker SharePoint Online list that comes with following sample data. Graphical user interface, application Description automatically generated
  3. Create a canvas Power App in preview environment and add connection to the Issue tracker list.
  4. Add a gallery control in the app and provide Issue tracker as data source. Your app should look as follows: Graphical user interface, text, application Description automatically generated
  5. Select the gallery control and go to the ideas 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. Text, letter Description automatically generated
  6. Type the following instruction in the input box to see the data from issue tracker where ID is 1: Show record with ID 1 and then click Get ideas 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.Graphical user interface, application Description automatically generated

What’s 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.

Some Examples:

Note: Make sure to select table, column and controls names from IntelliSense.

  1. Show records that have “fail” in the Title Graphical user interface, application Description automatically generated
  2. Show last 2 records from Issue tracker Graphical user interface, application Description automatically generated
  3. Sort issue tracker by ID descending Graphical user interface, application Description automatically generated

Things to consider:

  • This functionality is meant to assist citizen/pro developers with writing formulas faster.
  • GPT-3 functionality is currently available in galleries and data tables in PowerApps and is optimized with Search(), Sort(), SortByColumns(), Filter(), FirstN() & LastN() functions.
  • An ideal natural language request to generate Power Fx formulas should be clear, simple and should contain tables and column names.
  • IntelliSense is also there to help you complete typing the table, column and controls names to avoid any typos.
  • This feature is available in North America and currently supports English only.

Ref 1: From conversation to code: Microsoft introduces its first product features powered by GPT-3 – The AI Blog

Ref 2: Introducing Power Apps Ideas: AI-powered assistance now helps anyone create apps using natural language | Microsoft Power Apps

Ref 3: Introducing GitHub Copilot: your AI pair programmer | The GitHub Blog

1 comment

Comments are closed. Login to edit/delete your existing comments

  • Mohammed Rehmatullah

    This looks most excellent! Can’t wait to try this out! Thank you for this