Power Automate Custom Connectors – Path Parameters

Power Automate - Solutions

This blog post is to show you Path Parameters that are used with Web Requests and in turn used for Custom Connectors. If you’ve made a custom connector before and you’re familiar with API’s and what parameters are then great, you’re in the right place. If you haven’t there are several blog posts below that can be considered prerequisites to get you up to speed.

Path Parameters

What are Path Parameters? Path parameters are parameters built into the path of the URL and not added on to the end like Query Parameters. Unlike Query Parameters, Path Parameters are NOT OPTIONAL. This is because they’re required to complete the path of the URL. 

What does this mean?

An example of a URL can be https://www.flowjoe.io/2019/08/27/understanding-the-trigger-when-a-http-request-is-received/

Each of the ‘/‘ (forward slashes) represents a path, think of this as a folder system on your computer. In this example I’m on the ‘flow joe’ computer and I’m then going into the 2019 folder by putting /2019/ in the URL. If I had an API that had, for example, an ID of an employee in the URL then I would need to be able to modify this to select different employees. 

To then make these modifiable, we need to set the parameters within curly braces, if we do this, it lets Power Automate know that we want to be able to modify this and it will set the parameters up for us to access within a Flow.

Lets look at an example of this, using the URL https://api.companieshouse.gov.uk/search/companies/id/

Firstly, we need to modify the URL to have the curly brackets so let the Power Automate Custom Connector know that we have a Path Parameter. The new URL is then: https://api.companieshouse.gov.uk/search/companies/{id}

Custom Connector Request Example showing ID parameter

You can then see that the Custom Connector has added an ‘id’ parameter to the ‘Path’ section of the request.

If we now look in our flow we can see that we can enter a value that will be passed in to the URL in replace of the {id}.

Flow Example with ID Placement

The request URL from the example above would change from https://api.companieshouse.gov.uk/search/companies/{id} to https://api.companieshouse.gov.uk/search/companies/5