Microsoft Flow or Power Automate has currently 211 connectors available. Sometimes however you might find that you need to create custom connectors into applications that aren’t available in the list of connectors.
Now you’ve got a few options available:
- Wait for the connector to become available
- Use the standard HTTP request actions available within Flow
- Write a custom connector or get someone to do this for you
Before go any further. I hope that when you read this that you will realise that Microsoft Flow development is a bit like DIY. You try and do the job yourself but then half way through you realise that you should have asked an expert for help. Often Flow is seen as citizen development, where in my opinion it isn’t always the right approach to take.
You might already have found the Custom Connectors option in Flow. This is where you would start if you want to create your own connectors.
Now you can either upload an existing connector file or you can create a new connector within the Flow interface.
As I try to stick to the no code options where possible, I’m going to have a look at the create from blank option in the Create custom connector menu.
I’m going to use Microsoft Graph as an API for my examples today. Graph can do an awful lot already, and wouldn’t it be great if you could help all your users by making these MS Graph endpoints available within Microsoft Flow without them having to understand the complicated API layer of MS Graph.
Once I have supplied the connector name, I can supply the base details for my connector.
If you have ever looked at writing a swagger file then some of the above will look familiar. Just to give you an example of the a flow connector swagger files, have a look at the Create a Team in Microsoft Teams connector. To understand the above forms it might even be a good idea to have a look at the example swagger file.
In the above form I’m filling in the following details.
Icon background color: #123456
Description: Graph connector
Base URL: /
Then I click on the Security link.
Depending on your API you might need to select a different option here.
- No Authentication
- Basic Authentication
- API Key
- OAuth 2.0
With Basic Authentication you will need to supply a user name and password when you setup the connection to your API.
The API Key will give you options to ask for keys that your API needs. This is a typical approach for 3rd party SAAS solutions. You will have seen this in my SMS post from last week.
The OAuth option is a bit confusing. The below screenshot is how this option appeared for me. For some reason the form is pre-filled with details from an existing connection.
But help is at hand. This is a good moment to have a detailed look at the swagger file that is part of the Create a team project mentioned earlier.
All the authorisation URL details can be found here and this makes the development process a lot easier as I can simply copy/paste the urls across.
This is where the interesting bits start. So far it has been all about creating a connector but we are really after created actions and triggers.
I’m going to have a look at creating an action. All I had to do was click on New action and a new action is created. There is still some details to supply though.
Again I’m going to make use of the Microsoft Teams example.
The Summary, description and operationId are some of the details that need to be supplied. Note that the operationId needs to start with a capital. The operationId also needs to be unique within your connector. Multiple connectors can use the same operationId.
In the Request section you will need to supply the API path details ( Like the method Post, Get, Put, Patch and the URL that you are connecting to).
Then when you click on Create the Connector , the connector should become available within your flow environment.
Within Flow I can now find my action that I created within the Custom tab.
This now completes the basics on creating custom connectors. In my next post I will have a look at updating custom connectors in more detail.