Analyze User Feedback in SharePoint Online with Sentiment Analysis API and Power Automate

2 minute read

Analyze User Feedback in SharePoint Online with Sentiment Analysis API and Power Automate

Overview

The Sentiment analysis API provided by MS Azure helps to evaluate the user input and returns the sentiment score in the range of 0 (negative) to 1 (positive). This helps in analyzing the user feedback for any service.

In this article, we will use a SharePoint list as a backend to collect user feedback. The feedback will be then sent to Azure Sentiment analysis using Power Automate and store back the response in the SharePoint list.

Set up Sentiment Analysis API in MS Azure

Let us start by building our first building block in MS Azure Cognitive Services by creating Sentiment Analysis API. Follow the below steps to set up Sentiment Analysis API.

Create a resource

  1. Login to Microsoft Azure Portal (https://portal.azure.com).
  2. Click Create a resource.
  3. Select AI + Machine Learning
  4. Select Text Analytics.

Create a Text Analytics

  1. Fill in the details to create the Text analytics API.

    The parameters are as follows:

  2. Click Create.
  3. Once the deployment finishes, the Text analytics resource will be available to use.

  4. Note down the API Key and endpoint to authenticate your applications and start sending calls to the service.

Test the Computer Vision

We will use the API Console to quickly try the API without writing any code.

  1. From the left menu, select Quick start.
  2. Click API Console (V2).
  3. Select the testing console in the region where you created your resource.

  4. The selection of the region will form the request URL.
  5. Specify the resource name and query parameters.
  6. Specify the API key in Headers.

  7. In the request body, provide the custom text to analyze or use the default one.

  8. Click Send.
  9. The response will be shown as follows:

Set up SharePoint list

Create a SharePoint list with below schema:

Set up Power Automate Flow

Now we will set up Power Automate flow to integrate Text analysis API for analyzing user feedback submitted to the SharePoint list.

Follow the below steps to set up Power Automate flow:

  1. On the SharePoint list, click Automate > Power Automate > Create a flow.

  2. Select a template “When a new item is added in SharePoint, complete a custom”.

  3. Verify your connection to SharePoint.

  4. Click Continue.
  5. Add an activity “Text Analytics”, select action “Detect Sentiment”.

  6. Specify the connection name, Key from Azure and Azure endpoint.

  7. Click Create.
  8. Specify the SharePoint list column Feedback as Text. Optionally specify the language of feedback.

  9. Add an entry to the SharePoint list. This will trigger a flow. The OUTPUTS section will show the Score from Text Analytics API.

  10. Add an activity Update item available under the SharePoint category.

Test the Solution

In the SharePoint library, add a new item as user feedback. This will trigger a flow. A flow will call Sentiment analysis API for analyzing the feedback submitted to SharePoint. The flow will then update the returned metadata to the SharePoint column inside the list with a sentiment score.

Use Cases

The sentiment analysis can be useful in below scenarios:

  • Product reviews
  • Social media analytics (e.g. Tweets targeted to a hashtag)
  • Intellectual Property

Summary

Azure Sentiment analysis API helps to analyze the text input submitted to SharePoint and evaluate the user input and returns the sentiment score in the range of 0 (negative) to 1 (positive).

References

Hits

Leave a comment