Example: Using Azure Actions
For a shipping company to detect customer complaints about damaged packaging, and then automate their response, the workflow consists of the following actions:
Step 1: Add and configure an Office 365 trigger to get a new customer email
The following steps provide details of the values that you need to specify in the action form for this specific example. For detailed steps on configuring this trigger, see
Office 365 Triggers.
1. In the Select Trigger list, select New Email.
2. In the Folder ID field, select Inbox.
Step 2: Use LUIS Prediction to verify whether the email is a complaint about damaged packaging
The following steps provide details of the values that you need to specify in the action form for this specific example. For detailed steps on configuring this action, see
LUIS Prediction.
1. In the Query field, map the value of Subject from the Office 365 trigger data.
Step 3: Use Text Analytics to detect sentiment of the email
The following steps provide details of the values that you need to specify in the action form for this specific example. For detailed steps on configuring this action, see
Text Analytics.
1. In the Select Specific Service list, select Sentiment Analysis.
2. Under the Documents section, click Add, and do the following:
▪ In the Text field, map the value of Body Content Text from the Office 365 trigger data.
▪ In the Language list, select the language of the input text.
Step 4: Add a condition between LUIS Prediction and Text Analytics
1. Click the line between LUIS Prediction and Text Analytics to define a condition.
2. Define the condition as shown in the following image:
Step 5: Execute the Execute Logic App action in response to the customer complaint
The following steps provide details of the values that you need to specify in the action form for this specific example. For detailed steps on configuring this action, see
Execute Logic App.
▪ Customer Email
▪ Customer Name
▪ Complaint Sentiment
2. In ThingWorx Flow, in the Execute Logic App action form, select the appropriate Logic App defined in your subscription and the Trigger present in the logic app.
3. Under the Properties section, map the outputs to the following fields:
▪ Customer Email—From Email of Office 365 Trigger Data.
▪ Customer Name—From Name of Office 365 Trigger Data.
▪ Complaint Sentiment—Score of the Text Analytics action.
Now, if an email complaint is received by a shipping company, the complaint is automatically detected, the system detects if the complaint is about damaged packaging, and an automated response is sent to the customer.