Implementing AI features with AI Builder in Microsoft Power Apps allows users to integrate AI models without requiring advanced coding or machine learning expertise. AI Builder enables you to automate processes, make predictions, extract data, and create intelligent apps using predefined models or custom models. Below is a detailed step-by-step guide to implementing AI features using AI Builder in Power Apps.
Step 1: Understanding AI Builder
AI Builder is a Power Platform tool that allows you to easily add AI capabilities to your apps, flows, and solutions. It provides a range of pre-built AI models such as form processing, object detection, prediction, and text classification. You can also build custom AI models tailored to your specific needs.
Key features of AI Builder:
- Pre-built Models: Use AI models for text recognition, form processing, object detection, and prediction without writing any code.
- Custom Models: Create and train custom models to cater to your unique business needs.
- Integration: Integrate AI models directly into Power Apps or Power Automate flows.
Step 2: Preparing the Environment
Before you start implementing AI features, ensure that:
- You have the necessary Power Apps or Power Automate plan that includes AI Builder. AI Builder is available as part of the Power Apps per app and per user plans, but access to some advanced features may require a premium plan.
- You are logged into the Power Platform using your organizational account.
Step 3: Accessing AI Builder
To begin working with AI Builder, follow these steps:
- Log into Power Apps:
- Open the Power Apps portal.
- Sign in with your Microsoft 365 credentials.
- Navigate to AI Builder:
- In the left-hand panel, expand AI Builder.
- You’ll see options such as Model and Solutions where you can manage AI models.
- Get Started:
- Click on Explore AI Builder to view the available pre-built models and custom model creation options.
Step 4: Choosing the Right AI Model
AI Builder offers a variety of pre-built models that can be integrated into your apps or workflows. Here are the most common ones:
- Form Processing:
- Form processing allows you to extract information from documents, like invoices, purchase orders, or receipts, by recognizing and extracting text from predefined fields in those documents.
- Object Detection:
- This model allows you to analyze images and detect specific objects (e.g., products, animals) within the image, which can be used for inventory management or quality control.
- Prediction:
- Prediction models can predict outcomes such as customer churn, product sales, or financial outcomes based on historical data. You upload your data, and AI Builder trains a model to predict future values.
- Text Classification:
- This model is used to classify text into categories. For example, you could classify customer feedback into categories like “positive,” “neutral,” or “negative.”
- Entity Extraction:
- Extract specific information (like dates, locations, or prices) from unstructured text data such as emails or customer inquiries.
- Sentiment Analysis:
- Sentiment analysis allows you to analyze text data and determine whether the sentiment expressed is positive, negative, or neutral. This can be useful for analyzing customer reviews or social media comments.
Step 5: Creating a New AI Model
Now, let’s walk through creating a custom AI model using AI Builder.
1. Creating a Prediction Model (as an example):
- Go to AI Builder:
- In the Power Apps portal, under AI Builder, click on Predict.
- Select Create a model.
- Select Prediction:
- Choose Prediction as the type of model to create.
- Prepare Your Data:
- AI Builder requires a dataset to train the prediction model. You need historical data with labeled outcomes (e.g., previous sales data with labels of whether the sales were successful or not).
- You can upload your dataset from Excel, SharePoint, SQL Server, or other sources.
- Data Selection:
- Select the relevant fields from your dataset that you want the model to use. For example, if you’re predicting sales success, the model may use fields like “Sales Amount,” “Region,” and “Product Category.”
- Train the Model:
- After selecting your dataset and identifying the target variable (the value you want to predict), click on Train.
- AI Builder will automatically split the data into training and testing datasets. It will then train the model and evaluate its accuracy based on the testing data.
- Evaluate and Test:
- Once training is complete, you can evaluate the performance of your model by reviewing its Accuracy, Precision, Recall, and other metrics.
- You can also use sample data to test the model’s predictions and see how well it performs.
- Publish the Model:
- If you’re satisfied with the model’s performance, you can Publish it, making it available for use in Power Apps or Power Automate.
2. Creating Other Models (Form Processing, Object Detection, etc.):
- The process for creating models like Form Processing or Object Detection is similar, but you will need to provide specific types of data, such as images or forms with labeled fields, to train these models effectively.
- For Form Processing:
- Upload a set of forms with the fields that you want the model to extract. The more varied and consistent the data, the better the model will perform.
- For Object Detection:
- Upload labeled images containing the objects you want to detect (e.g., pictures of products with labels identifying the products).
- AI Builder will learn to recognize the object in different scenarios based on your labeled dataset.
Step 6: Integrating AI Models into Power Apps
After your AI model is trained and published, you can integrate it into a Canvas app or model-driven app in Power Apps.
- Add AI Model to Canvas App:
- Open the Canvas app where you want to use the AI model.
- Click on Insert from the top menu and select AI Builder.
- Choose the relevant AI model (e.g., Prediction, Form Processing).
- Set up the AI model by linking it to the correct data or fields.
- Configuring the AI Model:
- Once the model is added to the app, you can configure it by setting properties such as input data, output values, and actions to take when the model returns a result.
- For instance, if you are using a Prediction model, you can input new data (like a customer profile) and get the model’s prediction on whether a sale will be successful.
- Example for Prediction:
Set(predictionResult, AIModel.Run([CustomerData]))
This would call the model and store the result in the variablepredictionResult
.
- Using Output from AI Models:
- Based on the model’s output, you can trigger different actions, like displaying predictions on the UI, sending alerts, or updating a SharePoint list.
- AI Builder in Power Automate:
- You can also use AI Builder models in Power Automate flows. For example, after an email is received, you could automatically use an AI Builder sentiment analysis model to analyze the email’s sentiment and trigger different responses based on the result.
Step 7: Testing the AI Model in Power Apps
Once the model is integrated into your app, test its functionality by inputting new data and checking if the results are accurate and as expected. This may involve:
- Entering new customer information to see if the prediction model provides useful insights.
- Uploading different types of forms to see if the Form Processing model extracts data accurately.
Step 8: Publishing and Sharing Your App
Once you’ve tested the AI model thoroughly, you can publish your Canvas app to make it available for use within your organization.
- Save and Publish the App:
- Click File > Save and then File > Publish to make your app accessible to other users.
- Monitor and Retrain Models:
- Keep an eye on how well the AI model performs in real-world use. If the model’s predictions or results are not as expected, you may need to retrain it with new data to improve its performance.
Conclusion
Implementing AI features with AI Builder in Power Apps empowers you to enhance your applications with powerful, data-driven intelligence. By leveraging pre-built models or creating custom ones, you can automate tasks, make predictions, and analyze data effectively without requiring advanced technical knowledge. The step-by-step process outlined above provides a thorough guide to using AI Builder, from preparing your data and creating models to integrating them into your apps and workflows.
Let me know if you need more details or have any questions!