June 19, 2016 Leave a comment
Had a quick play on the preview version of Microsoft Flow, one of the newest toys offered by Microsoft for creating automated workflows between a wide range of online apps and services. One feature interested me is the integration of Microsoft translator service which automates the translation between languages. I was thinking what kind of business requirements we can use this feature to fulfill.
My immediate idea is the auto-generation (and possibly distribution) of translated versions of an Office document (Word, Excel or PowerPoint) when it is dropped into OneDrive. I did actually give it a try, unfortunately, the translator service cannot parse the Office document format, and I can only get the plain txt files translated and generated successfully. As I believe there is really not many people using notepad to author their business documents, this attempt was failed.
As a SharePoint guy, another idea came up was to automate language translations on SharePoint based solutions. One possible business requirement I imagined out is to auto-translate service/support requests and replies between the languages used in a multinational company (assuming not every employee can speak English). In the rest of this blog post, I prototyped a simple service request app to test Microsoft Flow and the language translation feature.
The service request app is expected to work in this way:
- An employee from a non-English speaking country raises a service request (using his or her local language) into a SharePoint list, namely “Service Requests”.
- Once the request is added into the SharePoint list, a Microsoft Flow workflow (“Service Request Submission”) is triggered to translate the request “title” and “description” into English which is the language used in the enterprise services/supports department. The translated “title” and “description” fields along with other information of the service requestor are added into a separated SharePoint list, “Service tracker” (As the current version of Microsoft Flow does not support the update of a SharePoint list item yet, we have to use a separate list to store the translated fields).
- The enterprise services/supports department then solves the request, adds reply in the “Service tracker” list in English and marks the status of the request as “Completed”.
- Another Microsoft Flow workflow “Service Request Reply” monitors the update of the “Service tracker” list items, if the status of a request is changed to ‘Completed’, the Microsoft Flow workflow translates the “reply” field into the language used by the requestor and then sends an email with the reply message to the requestor.
In this example, two Microsoft Flow workflows, “Service Request Submission” and “Service Request Reply”, are created. The detailed steps to create these workflows are listed below:
“Service Request Submission” Workflow
Firstly, we add a “SharePoint online – When a new item is created” step and configure the SharePoint site url and the name of the “Service Requests” list.
Then, we add the “detect language” action to detect which language the request is using.
After that, we add the “translate text” action to translate the “title” and “description” fields into English.
Finally, we create an item in the “Service tracker” list with the translated “title” and “description” fields, and also the other information of the requestor (name, email and language) that will be used in the “Service Request Reply” workflow later.
After the “Service Request Submission” workflow is created, we can raise a request to the “Service Requests” SharePoint list, something like:
Waiting a short while, an entry is added into the “Service Tracker” list with the translated fields and the other information of the requestor.
“Service Request Reply” Workflow
The “Service Request Reply” workflow starts from the enterprise services/supports department adding the reply to the “Service tracker” list and marked the “status” field as “Completed”.
Firstly, we add the “SharePoint online – When a new item is created” step and configure the SharePoint site url and the name of the “Service Tracker” list.
We then add a condition step to check if the “status” field is marked as “Completed”.
If so, we translate the “Title” and “Reply” fields from English to the language used by the requestor.
At the end, we send an Office 365 email to the requestor with the translated reply.
After the “Service Request Reply” workflow is triggered and executed, the requestor will receive the email with the translated reply.