All broken connections

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.

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 Power Automate Find Connections with Error

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 Environments

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

Get all your broken connections using Power Automate Microsoft Power Automate image 16

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 Power Automate image 17

Massage the connections data

The next action is a select.

Get all your broken connections using Power Automate Microsoft Power Automate image 18

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 Power Automate image 19

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 Power Automate image 20
Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using contact@veenstra.me.uk.

14 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 useful, 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.

  5. So is this to report on broken connections in your flows? I’m looking to report on broken links in a Sharepoint site. Is there a Power Automate solution to this? Or do I need to use some other application? It seems like a basic report that should be built into Sharepoint but I can’t find anything obvious. Thanks.

  6. Just to answer this, it’s most likely because the font on the blog here is using incorrect apostrophes.

    (To Pieter: I recommend using a font that will copy/paste into Flow naturally without having to paste and replace them)

Leave a Reply

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