On Microsoft Power Platform, AI can be used for several things, such as helping you build applications and create automated processes. By describing what you need in natural language, generative AI will create a database and an application for you. You can use this as a basis for further work on the application or process.
But just as exciting is the possibility of using artificial intelligence in applications you build.
Power Platform AI Hub
The Power Platform AI Hub is a dedicated area within Microsoft Power Platform and is a central place for all AI capabilities and resources.
The AI hub provides easy access to both prebuilt AI models and configurable AI models.
Among other things, there are ready-made models for retrieving information from receipts, invoices and identification.
In addition, there are also ready-made models for extracting the most relevant words and phrases from text, translating between more than 90 languages, detecting positive, negative, or neutral meaning in text data, and more.
In addition to this, it is possible to create your own models when the pre-built model is not suitable for your solution.
AI Prompts has a separate section in the Power Apps maker portal. Prompts can be used to provide instructions to generative AI to perform operations such as summarizing text/documents, generating email responses, generating synonyms, removing personal data from data, etc. Here you can create your very own prompt or instructions to get the result you want. This gives us almost limitless possibilities by leveraging AI Prompts in Power Apps or Power Automate flows.
Power Apps example
Let’s look at a simple example in a Power App to register and categorize a complaint to customer service. We will use an AI instruction to automatically categorize the message based on what the user types in the message field.
We’ve created an AI prompt under the AI Prompts section of the Power Apps portal.
The instructions look like this:
Classify the input text into one of the input Categories, or ‘unclear’. Analyze the key themes and context of the provided text and classify it into the most appropriate category from the list of categories. Take into consideration any subcategories, industry-specific terminology, and the possibility of ambiguous classification. If the text does not clearly fit into a single category, pick the closest category or label it as ‘unclear’. Your answer may only have the exact text of the closest category. Do not explain and do not use categories not listed.
When we use the instruction, we send the text we want categorized as ‘Input text’ and the categories we want to use as ‘input Categories’ The AI will then choose a category for our text, or return ‘unclear’ if it fails to place our text in any of the categories.
In the example in the animation below, we use these categories, “Customers”, “Internal”, “Authorities”, “Supplier”. The text that is entered is:
A customer contacted customer service to complain that their order, which should have been delivered within 3 business days, has still not arrived after 7 days. The customer expressed dissatisfaction with the delay and lack of updates on the delivery status.
This is automatically placed by the AI prompt in the Customers tab.
Summarize text
Another example for using AI Prompts could be to summarize a text. An instruction can then look like this:
Please summarize the given text in a way that is easy to understand for a general audience. Make sure to include all important information, including main ideas and important details, while keeping the order of the content logical. Remove any repetitive elements to make the summary as concise as possible without losing the original text’s integrity. If the original text is too short to condense, present it as the summary.
Always respond in the same language as the user asks the question
‘text’ is then the text we want summarized. The last line of instructions ‘Always respond in the same language as the user asks the question’ means that the instruction will return Norwegian if you ask in Norwegian and English if you ask in English and answer in any language you ask in.
And as the example in the image below shows, it will summarize an example of a complaint like this:
Dear Customer Service,
I am writing to you to express my deep dissatisfaction with my latest order with your company. I have been a loyal customer for several years, but this experience has really tested my patience.
Firstly, I ordered an item that was to be delivered within 3 working days. To my great disappointment, it took over a week before I received the package. I didn’t receive any updates along the way, and had to contact customer service several times to get information about the status of the delivery. This is completely unacceptable, especially when I paid extra for fast delivery.
When the package finally arrived, I discovered that the product was damaged. The packaging was torn open, and the item itself had obvious marks and scratches. I expect products from their company to be of high quality, and this was far from what I had hoped for. I again had to contact customer service to report the damage, and was met with a long wait and unhelpful responses.
As if this wasn’t enough, I also discovered that I had been billed incorrectly. The amount on the invoice was higher than what had been agreed upon at the time of purchase. This is a serious mistake that I expect to be corrected immediately. I have already filed a complaint about this, but have not yet received any confirmation or update.
I am very disappointed with how this situation has been handled. I expect you to take these issues seriously and provide me with a satisfactory solution as soon as possible. I look forward to hearing from you and hope that you can restore my trust in your company.
Sincerely,
This is summarized as:
A dissatisfied customer writes to customer service regarding a bad experience with a recent order. The customer complained about delayed delivery without updates, damaged product on arrival, incorrect billing, and poor customer service. The customer expects quick resolution and restoration of trust in the company.
Such prompts are easy to create and easy to use in Power Apps and in Power Automate flows. In the example we used in animation earlier to automatically categorize text, we have added an AI Prompt to the canvas app. This is added as a regular data source or connector in a Power App.
Then we can use AI Prompt in a Canvas app with such a formula:
'Incident Reporting Categorizing'.Predict("Comma separated list of categories", "the text you want categorized")
This will return the Customers tab in our case.
When creating an AI prompt, you can currently choose between two GPT models, GPT 4o mini or GPT 4o
Which model to choose depends on what the AI prompt is going to perform. The examples we have used here are simple instructions that normally work just fine with GPT 4o mini. Using AI prompts uses so-called AI Builder credits and has a cost, see section further down for license and cost. In general, it is 20 times more expensive to use model GPT 4o instead of GPT 40 mini. So here you should think about what is necessary.
It’s also possible to connect to your own data from Power Platform’s own database Dataverse. This provides exciting opportunities to apply generative AI to your own data.
These were just a few simple examples of using AI Prompts in Power Apps. There are unimaginable opportunities here to help us create more user-friendly, smart applications and automated processes.
License and costs
Using AI builder prompts uses so-called AI Builder credits. There are some AI builder credits included in other licenses, e.g. 500 AI builder credits are included for each Power Apps premium license you have, while Power Automate licenses give 5000 AI builder credits.
When this is not enough, you can buy AI builder credits in “packages” of 1 million credits.
For AI prompt, the pricing at the time of writing this article is December 2024 so that using a prompt with GPT 4o mini with about 700 words in and about 700 words out will consume 4 AI builder credits or about $0.002 The same use of a prompt using GPT 4o will cost 80 AI builder credits or $0.04, In other words, exactly 20 times as much.
Licensing and pricing can be difficult to figure out, but are generally well described in a larger document from Microsoft, the Power Platform Licensing Guide.
https://go.microsoft.com/fwlink/?linkid=2085130
Multimodal
One of the new features that is now in preview is multimodal capabilities in AI prompts. This means that we can handle different data types such as text, documents and images directly within a single natural language instruction. This gives us, among other things, the ability to find information in PDF files, interpret and possibly categorize content in images, etc.
Generative Actions
In the near future, we will also have access to Generative Actions for Power Automate. This makes it possible to use AI to automate processes in a completely different way than today. A Generative Action can, for example, be used to automate an approval process based on the content of an incoming email and compare this with the company’s procedures, all in one action described in natural language.
Conclusion
AI prompt is one of the simplest yet most powerful tools we have to leverage AI in Power Apps and Power Automate. This gives us great opportunities to structure unstructured information from, for example, emails, documents, web forms, etc. It allows us to automatically categorize information, remove personal data such as social security numbers, addresses, phone numbers, etc., from data, among other things. It is almost only the imagination that sets the limits for the possibilities that open up here when we build applications or automate processes. And since this is a low-code platform, we do all of this without writing a single line of code, just instructions written in natural language.