Categories: Microsoft Office 365

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.

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:

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 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.

Massage the connections data

The next action is a select.

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.

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.

Share
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.

View Comments

  • 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?

    • The display name might help a bit. Also there is more info returned by the get connection action. I could probably build up the url to the connection page.

  • 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???

  • 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?

    • 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.

  • 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.

Recent Posts

Create a Microsoft Teams team template

Recently I was asked about creating a team template in Microsoft Teams and apply this…

1 week ago

Who is in the office tomorrow, using Power Automate?

Do you want to know who is in the office tomorrow or the day after?…

2 weeks ago

8 top reasons to use Dataverse or SharePoint lists in the Power Platform

Why would you use Dataverse, if SharePoint lists gives you the option to avoid premium…

4 weeks ago

Filter by calculated fields in SharePoint using Power Automate

When you read items from a SharePoint list and you want to filter by calculated…

4 weeks ago

Expected String but got Null, when calling a flow from a Model Driven app

A few weeks ago I looked at calling flows from model driven apps. And for…

1 month ago

Customer Voice a.k.a. Forms Pro the database behind the magic

If you call Customer Voice still Forms Pro or not, have you ever looked into…

1 month ago
%%footer%%