Exercise - Use AI Builder actions in Power Automate
In this section, you will discover and use AI Builder actions in Power Automate through the creation of a simple flow.
Start by signing in to Power Automate and then following all instructions in this section.
Create a flow from a solution
To add AI Builder actions in a flow, create the flow from a Common Data Service solution.
Go to Solutions from the navigation bar on the left.
Create a new solution called My AI Builder solution and then open it.
Select +New > 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 will now add an AI Builder action.
Search for and add an AI Builder action
In this example, you will add the AI Builder action that allows sentiment analysis. Choose one of the following options to help you accomplish this task:
Search for intent, for example, "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.
Use the generic Predict action that allows you to use any type of model.
For this exercise, select the Analyze positive or negative sentiment in text action.
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 will 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.
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 I'll perform the trigger action 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.
Select Run flow. If your flow ran successfully, you would see all steps shown with a green tick.
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 have successfully created your first AI Builder flow.
For more information, see Use AI Builder in Power Automate.