Build a Power Automate flow by using AI Builder Language detection

Completed

In this exercise, you build a Power Automate flow that checks for the language of an email and then routes it to a specific email inbox. For more information, see Create a flow in Power Automate documentation.

The prerequisite for this exercise is to have Microsoft Dataverse in the environment where you're building your flow.

Create a flow that detects language and routes to a specific inbox

To create a flow that detects language of an email and then routes it to a specific email inbox, follow these steps:

  1. Sign in to Power Automate.

  2. Select Create from the left navigation bar and then select Automated flow.

  3. Pick a name for your flow and then select When a new email arrives as your flow's trigger.

  4. Select Create.

  5. In the copilot designer, select the + icon and then Add an Action and then search and select HTML to text.

  6. On the left hand side, select the Content field and then select the lightning bolt to bring up dynamic content. Select Body from the dynamic content tab.

  7. Select the + icon and then Add an Action again and this time search for Detect the language being used in text then select it.

  8. Select the text field, and then select the lightning bolt to bring up dynamic content. Select The plain text content from the dynamic content.

  9. Select the + icon and then Add an Action again and this time search for Control then select Apply to each.

  10. Select the Select An Output From Previous Step field and then select the lightning bolt to bring up dynamic content. Select theResult from the dynamic content in the Select output from previous steps field.

    Screenshot of what to select for the result property of detect the language being used in text.

  11. Inside of the Apply to each, Select the + icon, and then Add an Action and this time search for Control then select Condition.

  12. For the left side of the condition, select the lightning bolt to open dynamic content and select Language.

  13. Make sure the middle of the condition is set to is equal to.

  14. On the right hand side of the condition, enter fr (for French), en (for English), de (for German), and so on, to select what language you want to route to a particular email.

    Screenshot of Under If yes, Choose an action, the search results for send an email appear in the Actions tab.

Next we send an email if the language detected is French.

  1. Under the True side of the condition, select the + icon and then Add an action.

  2. Search for and select the Send an email(V2) action.

  3. Enter the To email address.

For the Subject, we build out a sentence using dynamic content and text.

  1. Using what you learned throughout this unit about dynamic content, update the subject so it looks like the following image:

    Screenshot of Under true branch, Send an email (V2), the Subject fields are filled in with parameters from previous steps.

  2. Select the Body field and add the Body field from the email.

    The email should resemble this image:

    Screenshot of Under true branch, Send an email (V2), the To, Subject, and Body fields are filled in with parameters from previous steps.

  3. Select Save and test the flow with a sample email.

Now, when emails arrive in a specified language, they're sent to the email that is specified in your flow.

You successfully completed this lesson on how to use AI Builder Language detection in Power Automate.