|
| 1 | +--- |
| 2 | +title: Triage incoming emails with Power Automate |
| 3 | +titleSuffix: Azure Cognitive Services |
| 4 | +description: Learn how to use custom text classification to categorize and triage incoming emails with Power Automate |
| 5 | +services: cognitive-services |
| 6 | +author: aahill |
| 7 | +manager: nitinme |
| 8 | +ms.service: cognitive-services |
| 9 | +ms.subservice: language-service |
| 10 | +ms.topic: tutorial |
| 11 | +ms.date: 01/27/2023 |
| 12 | +ms.author: aahi |
| 13 | +--- |
| 14 | + |
| 15 | +# Tutorial: Triage incoming emails with power automate |
| 16 | + |
| 17 | +In this tutorial you will categorize and triage incoming email using custom text classification. Using this [Power Automate](/power-automate/getting-started) flow, when a new email is received, its contents will have a classification applied, and depending on the result, a message will be sent to a designated channel on [Microsoft Teams](https://www.microsoft.com/microsoft-teams). |
| 18 | + |
| 19 | + |
| 20 | +## Prerequisites |
| 21 | + |
| 22 | +* Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services) |
| 23 | +* <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesTextAnalytics" title="Create a Language resource" target="_blank">A Language resource </a> |
| 24 | + * A trained [custom text classification](../overview.md) model. |
| 25 | + * You will need the key and endpoint from your Language resource to authenticate your Power Automate flow. |
| 26 | +* A successfully created and deployed [single text classification custom model](../quickstart.md) |
| 27 | + |
| 28 | + |
| 29 | +## Create a Power Automate flow |
| 30 | + |
| 31 | +1. [Sign in to power automate](https://make.powerautomate.com/) |
| 32 | + |
| 33 | +2. From the left side menu, select **My flows** and create a **Automated cloud flow** |
| 34 | + |
| 35 | + :::image type="content" source="../media/create-flow.png" alt-text="A screenshot of the flow creation screen." lightbox="../media/create-flow.png"::: |
| 36 | + |
| 37 | +3. Name your flow `EmailTriage`. Below **Choose your flow's triggers**, search for *email* and select **When a new email arrives**. Then click **create** |
| 38 | + |
| 39 | + :::image type="content" source="../media/email-flow.png" alt-text="A screenshot of the email flow triggers." lightbox="../media/email-flow.png"::: |
| 40 | + |
| 41 | +4. Add the right connection to your email account. This connection will be used to access the email content. |
| 42 | + |
| 43 | +5. To add a Language service connector, search for *Azure Language*. |
| 44 | + |
| 45 | + :::image type="content" source="../media/language-connector.png" alt-text="A screenshot of available Azure Language service connectors." lightbox="../media/language-connector.png"::: |
| 46 | + |
| 47 | +6. Search for *CustomSingleLabelClassification*. |
| 48 | + |
| 49 | + :::image type="content" source="../media/single-classification.png" alt-text="A screenshot of Classification connector." lightbox="../media/single-classification.png"::: |
| 50 | + |
| 51 | +7. Start by adding the right connection to your connector. This connection will be used to access the classification project. |
| 52 | + |
| 53 | +8. In the documents ID field, add **1**. |
| 54 | + |
| 55 | +9. In the documents text field, add **body** from **dynamic content**. |
| 56 | + |
| 57 | +10. Fill in the project name and deployment name of your deployed custom text classification model. |
| 58 | + |
| 59 | + :::image type="content" source="../media/classification.png" alt-text="A screenshot project details." lightbox="../media/classification.png"::: |
| 60 | + |
| 61 | +11. Add a condition to send a Microsoft Teams message to the right team by: |
| 62 | + 1. Select **results** from **dynamic content**, and add the condition. For this tutorial, we are looking for `Computer_science` related emails. In the **Yes** condition, choose your desired option to notify a team channel. In the **No** condition, you can add additional conditions to perform alternative actions. |
| 63 | + |
| 64 | + :::image type="content" source="../media/email-triage.png" alt-text="A screenshot of email flow." lightbox="../media/email-triage.png"::: |
| 65 | + |
| 66 | + |
| 67 | +## Next steps |
| 68 | + |
| 69 | +* [Use the Language service with Power Automate](../../tutorials/power-automate.md) |
| 70 | +* [Available Language service connectors](/connectors/cognitiveservicestextanalytics) |
0 commit comments