Translator On-Demand Glossary Translation Service
A reusable HTTP/Power-Apps-triggered service that translates submitted text to a target language using Microsoft Translator with a company glossary for consistent terminology, returns the result, and logs usage to Dataverse for cost tracking. Gives every app and flow one governed, on-brand translation endpoint.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This reusable service gives every app and flow one governed, on-brand translation endpoint built on Microsoft Translator V3. It is triggered over HTTP (a Request trigger, callable from a Power App, another flow, or any client). It applies a company glossary stored in Dataverse as Microsoft Translator dynamic-dictionary markup so brand/product terms always translate the approved way, returns the translated text, and writes a usage/audit record to Dataverse for cost tracking. Without a shared service, each app re-implements translation inconsistently and brand terms drift; a central endpoint enforces the glossary, standardizes behavior, returns a correlation id for tracing, and tracks spend (character counts) by request.
Use Case
Multiple apps and flows need translation. Rather than each one calling Translator directly (and re-defining glossary terms, response handling, and logging), they POST { text, to, from } to this single endpoint and get a consistent, glossary-aware result plus centralized usage logging. Typical callers: a Power App translate button, a support-ticket flow localizing replies, a marketing flow localizing copy.
Flow Architecture
When an HTTP request is received
RequestAccepts JSON body { text*, to, from }; text is required, to/from optional. Callable from a Power App, another flow, or any client.
Resolve Languages
Initialize variableMints a correlation id, resolves the target language (request to else env-var default), source language (request from else Auto-detect), and seeds a working text variable.
List Glossary Terms
Dataverse - ListRecordsReads glossary entries for the resolved target language from flowlibs_translationglossary.
Apply Glossary Terms
Apply to each + Set variableWraps each glossary source term in <mstrans:dictionary translation=...> markup in the working text (sequential, mutates a shared variable).
Translate Text
Microsoft Translator - TranslateTranslates the glossary-marked text; from/to from variables, body [{Text}]; flattens the V3 result.
Create Usage Log
Dataverse - CreateRecordWrites an audit row (correlation id, source/translated text, languages, character count) to flowlibs_translationrequestlog.
Respond With Translation
ResponseReturns { translatedText, targetLanguage, sourceLanguage, correlationId, characterCount } (HTTP 200).
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_DefaultTargetLanguage | String | es | Target language code used when the request omits to. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Microsoft Translator | shared_microsofttranslatorv | Translate |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords CreateRecord |
| Request | request | Request Response |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Glossary
- Add rows to the Translation Glossary table (Source Term, Translated Term, Target Language). Only entries matching the resolved target language are applied.
- Default language
- Change flowlibs_DefaultTargetLanguage to control the fallback when callers omit to.
- Endpoint security
- The Request trigger is unauthenticated by default; add a shared-secret header check (Condition on x-api-key) or front it with a Power App that holds the secret.
- Document mode
- For full files, switch to Translator V3 Document Translation (StartDocumentTranslation / GetTranslationStatus), which is async.
- Caching / cost
- Cache common phrase translations in Dataverse keyed by (text, target) to cut Translator spend; the usage log already captures character counts for attribution.
- Detected language
- To store the auto-detected source code, add a built-in HTTP call to the Azure AI Translator /detect endpoint (endpoint/key/region from env vars).
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Target language resolution
Request to else env-var default.
EXPR.02Glossary filter (per target language)
Filters glossary rows to the resolved target.
EXPR.03Dynamic-dictionary wrap
Forces approved terms verbatim.
EXPR.04Translated text
Flattened V3 translation.
EXPR.05Character count (cost log)
Captured for cost attribution.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.