Getting Started with GPT-3 in Power Platform
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.
To get started with the GPT-3 you need following things:
- Preview Environment in Power Platform.
- 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.
- Create a canvas Power App in preview environment and add connection to the Issue tracker list.
- Add a gallery control in the app and provide Issue tracker as data source. Your app should look as follows:
- 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.
- 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.
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.
Note: Make sure to select table, column and controls names from IntelliSense.
- Show records that have “fail” in the Title
- Show last 2 records from Issue tracker
- Sort issue tracker by ID descending
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.