ARTICLE AD
Introduction to AI Builder usage in Power Automate
100 XP
5 minutesMicrosoft Power Automate is a great way to automate AI Builder usage and exploit AI model results at scale.
AI Builder usage in Power Automate
Power Automate offers AI Builder actions that enable usage of all model types in flows. Adding AI Builder actions in your flow allows you to:
Perform model inference by using outputs of upstream actions (email attachments received, SharePoint files dropped, created records in a Microsoft Dataverse table, and so on).
Process model inference results in downstream actions (send by email, store in Dataverse records, message in Teams, and so on).
The following illustration shows a simple flow with three main stages:
Receive an email in Microsoft Outlook.Detect sentiment of the email body by using the AI Builder sentiment analysis model.Send an email notification with the sentiment detected in the email by using the Overall text sentiment output from the AI Builder modelIntroduction to AI Builder usage in Power Automate
100 XP
5 minutesMicrosoft Power Automate is a great way to automate AI Builder usage and exploit AI model results at scale.
AI Builder usage in Power Automate
Power Automate offers AI Builder actions that enable usage of all model types in flows. Adding AI Builder actions in your flow allows you to:
Perform model inference by using outputs of upstream actions (email attachments received, SharePoint files dropped, created records in a Microsoft Dataverse table, and so on).
Process model inference results in downstream actions (send by email, store in Dataverse records, message in Teams, and so on).
The following illustration shows a simple flow with three main stages:
Receive an email in Microsoft Outlook.Detect sentiment of the email body by using the AI Builder sentiment analysis model.Send an email notification with the sentiment detected in the email by using the Overall text sentiment output from the AI Builder modelExercise - Use AI Builder actions in Power Automate
In this section, you'll discover and use AI Builder actions in Power Automate through the creation of a simple flow.
Prerequisites
Access to Power Automate.A license or trial of the AI Builder.An environment with a Microsoft Dataverse database. (Applicable only for work or school accounts).A Microsoft Office 365 account with access to OneDrive for Business and Excel Online (Business).A basic understanding of Power Automate and experience with creating a flow is recommended.Create a flow from a solution
Start by signing in to Power Automate and then following all instructions in this section.
To add AI Builder actions in a flow, create the flow from a Microsoft Dataverse solution.
Go to Solutions from the navigation bar on the left.
Create a new solution called My AI Builder solution, select a Publisher, and then select Create.
Now select the My AI Builder solution solution to open it.
Select +New > cloud flow in the action bar on the top of the screen. The flow designer screen appears and asks you to choose the trigger action.
In the Triggers section, select Manually trigger a flow > + Add an input > Text. Name your input My Text, as shown in the following figure.
Select + New step. You'll now add an AI Builder action.
Search for and add an AI Builder action
In this example, you'll add the AI Builder action that allows sentiment analysis. Choose one of the following options to help you accomplish this task:
In the search field, enter "Analyze sentiment".
Open the AI Builder action group.
This action group lists all available AI Builder actions. You can pick the action from that page.
From the available actions, select Analyze positive or negative sentiment in text.
Configure the AI Builder action
Each AI Builder action has different parameters, depending on the underlying model requirements.
For the AI Builder sentiment analysis model, Language and Text are the two mandatory fields to fill in.
In the Language field, select English as the language.
In the Text field, select My Text, which is defined in the trigger action.
The My Text value will be provided during flow testing, so you don't need to focus on it right now.
Select Save. Your flow is now saved with an autogenerated name. You can change it by selecting the generated name on the upper-left corner of the flow designer screen. Name your flow My AI Builder flow.
Use the model's inference
For this exercise, you'll use a Microsoft Excel file in OneDrive to store the text sentiment that is detected by the AI model.
Create an Excel file named AI Builder results.xlsx in your OneDrive.
In this file, insert a table with two columns and then save the file (make sure that you use the Insert > Table function of Excel).
In My AI Builder flow, select + New step and then add the Add a row into a table action from Excel Online (Business).
Complete the Location, Document Library, and File fields to point to the Excel file on your machine.
In the Table field, select the name of the table that you created in your Excel file.
In the Column 1 field, add My Text, and in the Column 2 field, add Overall text sentiment.
Select Save.
Test the flow
Before productizing a flow, it's always a good idea to test it during design phase.
Select Test on the upper-right corner of the flow designer screen.
Select Manually - Perform the starting action to trigger it. and the select Save & Test.
Provide the value of the My Text field from the trigger action. This text is what you want to analyze the sentiment for. For this example, we'll enter It was the best sandcastle he had ever seen.
Select Run flow. If your flow ran successfully, you would see all steps shown with a green checkmark.
You can expand the actions to view the running inputs and outputs of each action, which is a good way to debug your flow.
Check that the line has been correctly added in the Excel file.
Congratulations, you've successfully created your first AI Builder flow.
For more information, see Use AI Builder in Power Automate.
Advanced usage of AI Builder in Power Automate
In this section, you'll discover how to install your AI Builder flows to fulfill your business scenarios.
Prerequisites
Access to Power Automate.A license or trial of the AI Builder.An environment with a Microsoft Dataverse database. (Applicable only for work or school accounts).A basic understanding of Power Automate and experience with creating a flow is recommended.AI Builder flow templates
Power Automate templates contain preconfigured logic that eases creation of flows for specific business purposes.
To create a flow from an AI Builder template, follow these steps:
Select the My templates tab in the left menu. The list of available templates will appear.
Enter AI Builder in the search bar and then press the Enter key. All AI Builder templates will be displayed, as shown in the following figure.
Select the Send a notification with the sentiment of manager's email using AI Builder template. You'll see a summary of the template with a list of the connections that will be used.
At the bottom, select Continue.
A preconfigured flow appears (at this stage, the flow isn't yet saved).
You can save the flow as-is or update it at your convenience:
Modify existing actions: input parameters, action name, or advanced parametersAdd new actionsRemove existing actions (this step will likely break the actions downstream)Once you're done, select Save and then you can test the flow.
Create a flow from AI Builder studio
From AI Builder studio, you can launch the creation of a flow by using your favorite model.
The following example shows a custom document processing model. The detail page of the model contains a Use model button (the model must be published). Selecting this button will open a right panel that offers multiple options, as shown in the following figure.
Selecting + Build intelligent automation and then Other opens the screen where you can create a flow from a template.
Selecting Continue opens a preconfigured flow with the custom model selected in the AI Builder action.
Check your knowledge
Answer the following questions to see what you've learned.
What is the purpose of using Power Automate flows for AI Builder?
To easily create AI models
Automatically create applications that use AI models
Automate and use AI models at scale
The purpose of using Power Automate flows for AI Builder is to automate and use AI models at scale.
Schedule training of your AI models
Where can you find preconfigured AI Builder flows that you can use to build your own flow?
My flows
Templates
You can find preconfigured AI Builder flows in templates.
Solutions
Power Apps
How can you incorporate AI Builder logic in a Power Automate flow?
By adding a new step in your flow and searching for the AI Builder action name
AI Builder logic is incorporated by adding a new step to your flow and searching for the AI Builder action name.
By developing your own AI Builder connector
By selecting AI Builder in the trigger action of your flow
By creating a Power Automate version of the AI model