Published:
Est. reading time: 4 minutes
Author: Mia Hatton
Your Social Listening tool includes a Retweet feature that automatically Retweets Tweets that match your search term and are found to have ‘positive’ sentiment. By following the steps below, you can add an approval process to this step, allowing you to send an email to yourself asking you to confirm the Retweet action. You can also adjust the threshold of sentiment that is considered a “positive” Tweet, by following the steps in this guide.
Your Social Listening tool includes a Retweet feature that automatically Retweets Tweets that match your search term and are found to have ‘positive’ sentiment. By following the steps below, you can add an approval process to this step, allowing you to send an email to yourself asking you to confirm the Retweet action.
You can also adjust the threshold of sentiment that is considered a “positive” Tweet, by following the steps in this guide.
How to adjust the threshold of a negative Tweet
Open your
SocialListening-Twitter
Logic App from the Azure Portal.Open the Logic App Designer.
Select ‘Analyse each tweet’ from the boxes shown on screen.
Select ‘Handle tweets depending on outcome’
You can change the threshold of a negative tweet by changing the ‘Score’ value, by default negative tweets are less than 0.4, you can lower the threshold or higher it to suit your requirements.
Click save to make sure you do not lose your changes π and check the popup in the top right corner to make sure it has saved OK, if not it will give you feedback that will help you find what has gone wrong.
Add a Retweet approval process
By default the Logic App automatically retweets tweets with a super positive sentiment of 0.9, you can also change the threshold of super positive and if you do not want the retweets to happen automatically, you can also add an approval step per positive tweet.
From where we left off in the instructions above, follow these instructions to see how you can add an approval step:
In ‘Handle tweets depending on outcome’, if a tweet is negative, it execute the instructions in the ‘True’ path, otherwise the instructions in the ‘False’ path. In the False path select ‘Check if tweet is super positive’.
You can now change the threshold of super positive from the default 0.9 to suit your requirements.
Now select the ‘True’ path, as we need to add our approval step in the True section.
Remove the existing ‘Retweet’ box to simplify the next steps by clicking on the right side of the box and select ‘delete’ from the dropdown.
Now select ‘Add an action’ inside the True box.
In the popup that appears, search for ‘Send approval email’ and select the one with the appropriate email service, in my case that is the ‘Office 365 Outlook’.
You now need to configure the approval email;
- Add email address for the user responsible for approving the retweets
- Check the ‘Body’ and ‘Header Text’ from the ‘Add new parameter’ dropdown'
- Fill in the ‘Body’ and the ‘HeaderText’ to match the image below
Note: You will need to search for the dynamic content from the popup box that appears, to find ‘Tweet id’, ‘Tweeted by’ and ‘Tweet text’. Two results appear for each item, make sure to select the one with the purple icon, to match the image below.
Select Add an action from below the ‘Send approval email’ box, and search for and select ‘Condition’
Now you must fill in the condition, first you need to add dynamic content to the first box, search for SelectedOption in the search bar and select it, make sure the selected middle field is is equal to and finally, type in Approve in the last field, so it matches the image below.
Finally we will add the Retweet action to the ‘True’ path, so select ‘Add an action’ in the True box below our condition, then search and select Retweet, and in the ‘tweet id’ field we need to add the ‘Tweet id’ from dynamic content, like we did above in the email configuration, so search for ‘Tweet id’ and choose the one with the purple icon to match the image below.
Click save to make sure you do not lose your changes.
What does the approval process do?
The approval email will be triggered whenever a positive Tweet is detected. The specified recipient(s) will receive an email like the one below, allowing them to Retweet with a single click without leaving their inbox. When ‘Approve’ is clicked, the logic app will continue Retweet the Tweet and the tweet is skipped if you select ‘Reject’.
How can I learn more about customising my logic app?
You can read more about approval workflows with Azure Logic Apps here.
Read more about Condition actions here.
Read more about the Office 365 Outlook connector here.