Power Platform custom connector

Michal Molka
3 min readJun 21, 2024

--

Today, we create a Power Platform custom connector and use it in a Power Automate flow. This topic is related to this post: Postman and Azure Translate Text API. Reading it isn’t necessary, but it can give you a background.

Our custom connector will be able to use an Azure Translate Text API and translate a provided text. By the way, there are out of the box Power Automate actions which are used for gaining the same goal.

For purpose of this article, let’s assume, that we need to use the Translate API for some reason.

In the Power Platform portal go to Custom Connectors then hit a New custom connector from blank.

Fill a Host with an endpoint address and a Base URL with a method name.

Host: api.cognitive.microsofttranslator.com

Base URL: /translate

The custom connector gets access through an API key. So that we use it in a security section:

  • Authentication type: API Key,
  • Parameter name: Ocp-Apim-Subscription-Key,
  • Parameter location: Header.

In a Definition tab add a New Action. In a General section: a GetTranslation word — any value can be imputed.

For a request section, select an Import from sample button.

Verb:
POST

URL:
?api-version=3.0&to=pl

Headers:
Ocp-Apim-Subscription-Region westeurope
Content-Type application/json

A request body:
[
{
"Text": "This is a sentence that is translated into a Polish language."
}
]

Now, a request section is filled with data.

One additional thing. A data type for an api-version query parameter was automatically detected as a number and has to be changed into a string type. So, edit the parameter.

In a response section select the Import from sample button as well.

And paste and exemplary response.

[
{
"detectedLanguage": {
"language": "en",
"score": 0.98
},
"translations": [
{
"text": "An exemplary text.",
"to": "pl"
}
]
}
]

Now, we can test the custom connection.

As you see, the custom connector is visible from a Power Automate context.

--

--

Michal Molka

Architect | Azure | Power BI | Fabric | Power Platform | Infrastructure | Security | M365