Tired of manually responding to emails in different languages?
If you’re using Dynamics 365 and your team receives customer emails in multiple languages, you know how tedious it can be to manually identify each language and send a matching acknowledgment. It slows you down, increases response time, and adds pressure on your support team.
What if you could detect the customer’s language and send a personalized response, automatically?
Let’s walk you through how to use AI Builder’s Language Detection model integrated into Power Automate to create a multilingual email acknowledgment flow in just a few steps.
Step-by-Step Guide: Using the Language Detection Model in Power Automate
To get started, go to make.powerautomate.com and create a new flow.
- Develop a Power Automate flow that triggers manually when an email record is selected in Dynamics 365. This allows you to test and run the process only on specific emails.
- Next, add the Get a row by ID action to fetch the details of the selected Email Message record. This step ensures that the flow captures the complete email body along with its metadata, which will be required in the following steps.
- Then, add the HTML to text action and pass the description field from the Email Message record.
This step converts the HTML description of the email into plain, readable text that can be used for further processing.
- Add an Initialize variable action and store the output from the HTML to text action. This variable will hold the plain description of the email for use in the next step.
- Then, add the Detect language action and provide the plain text as input. In this case, use the email description to identify the customer’s language.
The language detection model in Power Automate provides three important outputs:
- Results – a list of detected languages along with their scores.
- Confidence score – a value between 0 and 1 that shows how certain the model is about its prediction (the closer to 1, the higher the accuracy).
- Language code – a short code such as en for English, fr for French, zh_chs for Simplified Chinese, or ru for Russian, representing the detected language.
- Then, add an Initialize variable action to store the language code returned by the Detect Language step. Since the model may return multiple language codes, take only the first result from the output.
Use the following expression:
first(outputs(‘Detect_language’)?[‘body/responsev2/predictionOutput/results’])?[‘language’]
This expression retrieves the first language code detected by the model.
- Then, add a Switch action and pass the language variable to it. Create separate cases for each language code you want to support, so the flow can branch into the appropriate path based on the detected language.
- Add the Send an email (V2) action inside each case and draft the acknowledgment message in the respective language. In the Default case, configure the email in English so that if no matching language code is found, the sender still receives a response.
For example, if the email description is detected as French, the flow automatically sends a French acknowledgment to the sender. If the language doesn’t match any predefined cases, the default English acknowledgment is sent instead.
Final Thoughts
With this approach, you can easily automate multilingual email acknowledgments in Dynamics 365, ensuring faster responses and improved customer experience.
By leveraging AI Builder’s Language Detection model within Power Automate, businesses can build scalable flows that adapt to multiple languages, reduce manual effort, and bring greater efficiency to support processes.