Blog
AI - Tips for creating Dataverse tables with Co-Pilot
July 3. 2023
Copilot in Power Apps offers a far quicker and smoother way to create Dataverse tables. However, the way that it currently works can be quite quirky. Here are some tips on how to work more effectively with Copilot.
The ability to create Dataverse tables and apps with Co-Pilot has been out in preview for a bit. This process should make it faster and easier to build apps.
Having tested the table creation feature against several practical real-life projects, here's a review of how well this works and some tips to make the most of this AI functionality.
Use case scenario - the table structure that we want to create with AI
To give a practical example of creating a table with AI, let's take the scenario of a system that calls a web service to make an online payment. The requirement is to create a table to store the payment response. The response JSON looks like this.
{
"statusCode": "2001",
"statusDetail": "The Authorisation was Rejected by the vendor rule-base.",
"transactionId": "759F9DE3-0641-324D-AAF9-825C0608A305",
"bankResponseCode": "00",
"status": "Rejected",
"paymentMethod": {
"card": {
"cardType": "Visa",
"lastFourDigits": "0006",
"expiryDate": "0320",
"cardIdentifier": "cardTokenUUID",
"reusable": false
}
},
"amount": {
"totalAmount": 10000,
"saleAmount": 10000,
"surchargeAmount": 0
},
"currency" : "GBP",
"3DSecure": {
"status": "NotChecked"
}
}
To highlight how we would generate a SQL Server table script with Chat GPT or Microsoft Bing Chat, we would paste the JSON and ask ChatGPT/Bing to produce the 'create table' script.
As the screenshot below illustrates, Bing Chat does an excellent job of generating the table script.
Therefore, this is the 'benchmark' process on which to assess the capabilities of the Copilot feature.
How to create a Dataverse table with Copilot - the challenges
To demonstrate the Copiplot table creation process, let's attempt to create the same table with Copilot.
The Copilot preview doesn't accept more than 250 characters. This unfortunately makes it very difficult to add multiple columns, and it becomes very tedious to split the request over multiple conversations.
Given the columns that I've asked Copilot to create, it can guess the data type based on the example data in the JSON. This is great, but there are cases where Copilot gets it wrong.
A slightly irritating point is that in these cases, it isn't possible to use the dropdown to quickly change the data type because all the column properties are greyed out.
Instead, it's necessary to use natural language (for example,
"please change the data type of Apply3DSecure to yes/no") to change the
data type which is significantly more time-consuming.
Since this is a preview feature, I find that Copilot can sometimes quit with a 'Something went wrong' error.
Also, it's important to try to keep conversations short because if it goes on for too long, it can fail and report the error "Sorry, your conversation activities have reached the maximum limit".
How to more effectively use Copilot to create Dataverse tables
To overcome the challenges with the Copilot preview mentioned above, here are the tips I use to work better with Copilot.Let's take the example scenario where we have HTML that corresponds to a web form, and we want to construct a table to store the user input.
An effective first step is to pre-parse the data with Bing Chat or ChatGPT.
As shown in the screenshot beneath, we can use this to extract a clean list of column names and data types.
We can then pass this list to Copilot. Because we specify the data types in the input, Copilot will do a fantastic job of creating the columns correctly. There will be far less 'back and forth' required to correct any mistakes.
If we do need to make modifications to the table schema, it's a good idea to batch similar requests in the same prompt. This is because Copilot can take up to 10 seconds to respond to each question, so by reducing the number of prompts, we can save time and minimise the possibility of Copilot quitting before we've completed our work.
Conclusion
Creating Dataverse tables with Copilot offers a vastly improved way of defining tables. Compared to using the traditional designer, it offers a faster and much less clunky way of building tables.
This post highlighted some of the challenges with the current Copilot preview. The main challenge is that each prompt is limited to 250 characters and that Copilot can 'give up' after a while. I hope that Microsoft will resolve these issues as the feature progresses.
This post also described some techniques to overcome these difficulties to help us work more effectively with the Copilot table designer.
This post also described some techniques to overcome these difficulties to help us work more effectively with the Copilot table designer.
- Categories:
- ai
Previous