Use the sentiment analysis prebuilt model in Power Automate
Create a flow that uses the AI Builder sentiment analysis prebuilt model
Sign in to Power Automate, select the My flows tab, and then select New > +Instant-from blank.
Name your flow, select Manually trigger a flow under Choose how to trigger this flow, and then select Create.
Expand Manually trigger a flow, select +Add an input, select Text as the input type, and set as input title My Text.
Select + New step, search for the term AI Builder, and then select Analyze positive or negative sentiment in text in the list of actions.
Select the language in the Language input and specify the My Text field from the trigger in the Text input:
In the successive actions, you can use any fields extracted by the AI Builder model. For example, you can add lines to an Excel file for each sentence using Sentence sentiment, Probability sentence is positive and Probability sentence is negative:
Congratulations! You've created a flow that uses the sentiment analysis model. Select Save in the upper-right corner, and then select Test to try out your flow.
|Text||Yes||string||Text to analyze||Text sentences|
|Language||Yes||string||Language of the text to analyze||Item in a list of predefined languages or a language code (ex.: "en", "fr", "zh_chs", "ru")|
|Overall text sentiment||string||Overall sentiment of the analyzed text||Positive, neutral or negative|
|Probability overall text is positive||float||Probability of the positive sentiment in the analyzed text||Value in the range of 0 to 1. Values close to 1 indicate greater confidence that the identified sentiment is accurate|
|Probability overall text is negative||float||Probability of the negative sentiment in the analyzed text||Value in the range of 0 to 1. Values close to 1 indicate greater confidence that the identified sentiment is accurate|
|Probability overall text is neutral||float||Probability of the neutral sentiment in the analyzed text||Value in the range of 0 to 1. Values close to 1 indicate greater confidence that the identified sentiment is accurate|
|documentScores||object||Object containing overall scores||Positive, neutral and negative scores|
|sentences||List||List of sentence data structures containing sentences overall sentiment and scores||Sentence sentiment, positive, neutral and negative scores|
|Sentence sentiment||string||Sentiment of the analyzed sentence||Positive, neutral or negative|
|Probability sentence is positive||float||Probability of the positive sentiment in the analyzed sentence|
|Probability sentence is negative||float||Probability of the negative sentiment in the analyzed sentence|
|Probability sentence is neutral||float||Probability of the neutral sentiment in the analyzed sentence|
|sentenceScores||object||Data structure containing sentence scores||Positive, neutral and negative scores|
Use sentiment analysis to analyze incoming Dynamics 365 emails
Power Automate provides a template that enables you to analyze incoming Dynamics 365 emails by using AI Builder sentiment analysis. This template requires some customization of your Common Data Service email entity before you can use it.
Create an attribute in your Email Messages entity in which to save the sentiment analysis results.
For information about how to create an attribute, see Create and edit fields for Common Data Service using Power Apps portal.
Sign in to Power Automate.
In the left pane, select Templates, and then search for AI Builder sentiment.
Select Analyze sentiment of Dynamics emails using AI Builder.
Select your environment, then type Email Messages in the Entity Name field, and type Organization in the Scope field.
Next, the template shows messages from draft emails and received emails. You can filter these if you want to perform sentiment analysis only on selected email statuses. For a list of status codes, see email EntityType.
Select Add sentiment to CDS Email Entity, select Show advanced options, and then locate the attribute you added in step 1.
Finally, add Global sentiment from the Dynamic content list.
If you want this field to be visible in your email grid view, follow these steps:
Go to the view/form designer, and add the custom field you created in step 1 of the preceding procedure. For information about how to add the column to your view, see Add a column to your view.
Then add a field to the form. For details, see Add a field to a form.