Build a Power Automate flow by using AI Builder Language detection
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:
Sign in to Power Automate.
Select Create from the left navigation bar and then select Automated flow.
Pick a name for your flow and then select When a new email arrives as your flow's trigger.
Select Create.
In the copilot designer, select the + icon and then Add an Action and then search and select HTML to text.
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.
Select the + icon and then Add an Action again and this time search for Detect the language being used in text then select it.
Select the text field, and then select the lightning bolt to bring up dynamic content. Select The plain text content from the dynamic content.
Select the + icon and then Add an Action again and this time search for Control then select Apply to each.
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.
Inside of the Apply to each, Select the + icon, and then Add an Action and this time search for Control then select Condition.
For the left side of the condition, select the lightning bolt to open dynamic content and select Language.
Make sure the middle of the condition is set to is equal to.
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.
Next we send an email if the language detected is French.
Under the True side of the condition, select the + icon and then Add an action.
Search for and select the Send an email(V2) action.
Enter the To email address.
For the Subject, we build out a sentence using dynamic content and text.
Using what you learned throughout this unit about dynamic content, update the subject so it looks like the following image:
Select the Body field and add the Body field from the email.
The email should resemble this image:
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.