Translate Files in Power Automate with Encodian Flowr

November 26th 2024

We have recently added exciting new AI capabilities to Flowr with more planned.  For this post, we will show you how you can easily translate files into multiple different languages using our new ‘AI – Translate File‘ action, not forgetting the following actions which can be used to translate text:

 

Scenario

Consider the following scenario: Our fictitious company is based in the UK, Spain, and France, with the marketing team residing solely in the UK. The marketing team creates all content using English, but they need to develop Spanish and French translations upon completion. This blog will show how this process can be automated when new documents are added to a SharePoint library.

SharePoint Configuration

We have added a ‘Language’ column to the SharePoint library, which stores marketing content. This ensures the language of each document is clear and allows for language-based filtering. As the marketing team creates documents in English, the default for this column is set to ‘English’; thus, the documents are automatically tagged when uploaded.

Power Automate Flow

The flow uses the ‘When a file is created (properties only)’ SharePoint trigger action:

As we create two new files in this flow, we must add a trigger condition to prevent a recurring loop. Since all uploaded files are set to English, we can use this in the trigger condition to ensure the flow only runs if the file’s language is English.

@equals(triggerOutputs()?['body/Language']['Value'], 'English')

Once the flow has been triggered, we need to get the file content.

Now, we can start the translation! I have split this step into two parallel branches so that the translation and document creation happen simultaneously for both languages. This will improve the speed and efficiency of the flow. We will complete the translation using Flowr’s ‘AI – Translate File’ action in the ‘Encodian – General’ connector.

I have kept the ‘Source Language’ to auto; however, you can manually select the source language if necessary.

More information, such as supported file types, data residency and the number of credits the connector uses, can be found below:

Now we have the translated document, we need to upload the document to SharePoint and update the Language column to either French or Spanish.

When creating files, the ‘Filename’ must include the file extension. Be careful when using parallel branches to ensure that you are using the correct dynamic content for that branch (make sure you are using the Spanish-translated document and French-translated document in the right branch).

Results

I have uploaded the following document into the SharePoint folder:

 

Once the flow has run, the French and Spanish documents will appear in the folder.

Let’s look at the Spanish document:

And let’s look at the French:

As we can see, the documents have been successfully translated into the target language.

It’s important to remember that AI can sometimes make mistakes! It is really important to still have a human review the documents before they are used. 

 

Video

Check out Sophie’s companion video on YouTube:

Author
Sophie Charlwood

Technical Evangelist

You might also be interested in...