All broken connections

Get all your broken connections using Power Automate

To get all your broken connections in the Power Platform can be a challenge. In this post I will use flow to collect the broken connections.

Options to get broken links

In this post I will have a look at using a flow to collect the broken connections after someone contacted me today about the PowerShell solution that I wrote a while back.

At first I started building my flow and then I quite quickly ended up with the hated nested apply to each steps.

Get all your broken connections using Power Automate Microsoft 365

Noooooooooo!!!!!

The right way to collect broken connections

The better way is to create a flow that doesn’t use any nested apply to each steps like the one below:

Collect all broken connections in less than 20 seconds.

Ok, you might want to schedule these flows on a daily basis or so and then send an email at the end, but that is a bit of detail that we can worry about later. In this post I want to focus on getting the failing connections only.

Get Enviroments

We all use multiple enviroments, don’t we? so I want to step through the different environments first. so after my intial trigger of the flow I will add a Get Environments action.

Get all your broken connections using Power Automate Microsoft 365

Get Connections

No need to bother with an apply to each here. Power Automate will add it automatically as we complete the configuration of the Get Connections action.

So just add the get connections and select name form the dynamic properties as shown below.

Get all your broken connections using Power Automate Microsoft 365

Massage the connections data

The next action is a select.

Get all your broken connections using Power Automate Microsoft 365

I’m going to use the following expressions in the above select.

From: outputs(‘Get_connections’)?[‘body/value’]

Map:

item: item()?[‘name’]

status: item()?[‘properties/statuses’]

displayname: item()?[‘properties/displayName’]

Now we just need to filter the connected connections out and we have all the connections that are in trouble.

Get all your broken connections using Power Automate Microsoft 365

now all we need to do is collect the results from the filters and we will have a single array with all the failed connections from all environments.

Get all your broken connections using Power Automate Microsoft 365

9 thoughts on “Get all your broken connections using Power Automate

  1. Thanks, Pieter! Very interesting! Once we have the information, how do we find/navigate to the connection in question to fix it (if it’s our own)? The connection name seems to be a GUID. Is there a URL we can construct with that that will take us to the connection?

  2. Hi Pieter,

    Very usefull, as always.
    Would you be So kind to update the blog and provide the details that are in the first-function of the filter step???

  3. Is anyone else getting a long list of “broken” connections, but on investigation finding that

    a) A lot of the broken connections are from flows that were deleted long ago, and

    b) Even on the flows that are not deleted, many of them seem to be working just fine and are displaying no errors?

    1. The first point yes. That is expected. Connections are used by flows. They aren’t part of the flows.

      On the second point. I would expect that running flows that don’t actively use an action that uses a disabled connection to be fine. You wouldn’t be able to edit these flows, but they might quite well be able to run as long as they don’t hit the affected actions.

  4. Hi Pieter,
    I’m running it an “expression is invalid” when I enter this.
    Could this because my Flow environment is running in the Dutch language?
    Regards,
    Rob.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: