My Power Platform — finding your flows and apps across environments

Loryan Strant
REgarding 365
Published in
8 min readAug 10, 2023

--

In our Microsoft 365 tenant, I have many Power Apps apps (that doesn’t sound right, does it?) and Power Automate workflows that reside in all kinds of various places.

The Challenge

Finding the one I want can sometimes be challenging, as they can be found in:

  • Different Power Platform environments
  • Either under “Cloud flows” or “Shared with me” (which oddly is where workflows that I have shared with others are found)
  • Within Power Platform solutions (which nowadays show up under “Cloud flows” as well, for extra confusion/clarity)

While there is a search capability within the Power Automate and Power Apps web interfaces, it’s limited to that environment only.

When building workflows or apps I often borrow components from existing ones I’ve built, so often I would find myself spending a chunk of time hunting for things — and quite possibly not finding them due to the naming.

The Solution… kind of

Within the CoE Starter Kit is the Developer Compliance Center which does provide a way for users to find their items, however I found the interface a little clunky — so I modified it.

While this was fine, it still uses the Dataverse connector — which unfortunately many users wouldn’t be licensed for.

So built a cut-down version that used functionality which is available to all users.

The Solution… again

I built a simple canvas app that allows me to search based on words, and filter based on item type (app or flow), as well as environment where they are found.

While in this version I opted to remove the description, I did add the date they were created and modified — as that might help me with a mental prompt.

And if I do want to see the description then I can simply click the button to be taken to the details page.

The benefit of surfacing this in a Power App instead of just searching a list, is that provides results a lot faster and can be made to look prettier (slightly, as UI is not my forte).

How it works

Apart from the app, there are two primary components: a List sitting in OneDrive (the “My Lists” location), and a workflow that scans environments for all apps and flows where I am an owner.

The list

The columns required for the list follow this schema:

Name Type Title (renamed to “Object ID”) Single line of text ObjectName Single line of text ObjectCreated Date and Time ObjectModified Date and Time ObjectLink Hyperlink ObjectType Single line of text EnvironmentName Single line of text

What it looks like is this:

The flow

How the workflow works is simple:

  1. Extract my user ID from my M365 profile (as is used in the maker ID field of app and flow metadata)
  2. Clear out the current list content
  3. List environments I have access to
  4. Scan each of them for apps and flows
  5. Record them in the list

Expanding this out, I have it set to run at 1am every day and also use variables for the URL of my OneDrive as well as the display name of the list.

Also, for the “Get my profile” I only need to return my ID — not the full set of profile information.

Within the scope to remove existing items, I’m opting for the simple approach of getting each item and then deleting it via an apply to each loop. This could be optimised using the batch deletion method using the SharePoint REST API, but this works fine. To make it a bit faster I’ve applied concurrency control in the loop so it doesn’t run sequentially.

Get all my flows

Within the scope of the “get all my Flows” I’ve placed an action to list the environments I have access to, and then a loop to run against each of them. Within that loop I’ve put a condition to see if there are any items returned (using the length of the array), and if so — work through each flow. Using this condition avoids potential failures within the workflow if there are no items returned and it can’t perform the next step.

Within the apply to each loop, I have an action to create an item in my list.

The replace action used for ObjectLink allows me to format the URL in a way that I can get to the details page of any workflows:

replace(item()?[‘id’], ‘/providers/Microsoft.Flow’, ‘http://make.powerautomate.com')

Get all my apps

Due to the nature of the data returned by the various actions and connectors, I had to create a separate method to get the details for my apps and to filter out where I’m an owner — as Power Apps does not have a “List my Apps” action.

Here, we get use data from the “Get Environments” action and then filter where the owner of the app is equal to my user ID. Also, because this action can’t list just my apps on its own, I’ve had to increase the page size to return more results.

Now, it might be possible to actually expand the filter query on the “Get apps from each environment” to do the action of the filter array action, but, laziness.

Then, for each result returned we again create an item in our list:

And that’s it for the workflow.

Performance

In my work tenant it takes approximately 7 minutes to run. Some environments take longer to run as I have more workflows in there (a couple in particular). Here’s an example of the performance:

I could add concurrency control here to make them run faster, but it’s not a priority given the current duration.

The app

Only a single screen and gallery are used for the app itself, and it only needs to use the SharePoint connector in order to access the list created in your OneDrive.

The drop-down & combo boxes are made up of the following:

The total box performs a count of the rows in the gallery, which means it updates when the results in the gallery change:

And our gallery filters the results based on the drop-down & combo boxes, as well as search box — allowing us to use all 3 if we want.

The fields shown in our gallery:

Most importantly, my name at the bottom will take you to my blog site. So, if you’re planning on sharing this with others and removing any attribution to the creator — that’s where to do it.

Installation

To get this solution working in your environment should only take a few minutes. I originally planned to share this as a solution with both the flow and app included, however that would not allow for multiple people to use it in the same environment and have it return different results. Unfortunately this means a small bit of fiddling to get it going.

The first step is to create the SharePoint list as per the above schema.

Secondly, download both the MyPowerPlatform-App and MyPowerPlatform-Flow files from my GitHub repository and import them both into a Power Platform environment of your choosing.

As part of the installation process you may need to create some connections: Office 365 Users, Power Apps for Makers, Power Automate Management, and SharePoint.

Once the flow is imported, modify the workflow to update the SiteURL to your OneDrive location, as well as the display name of the list you created. It’s important that you put in the display name, whether it has spaces or not. (Don’t be confused by the fact that my list display name doesn’t have spaces.)

For the app, you will actually need to delete the SharePoint connector and create it again — making it point to your list.

(Otherwise, it will be attempting to connect to my list.)

And that’s it! From this point, run the workflow, validate that it worked and the data is there, then open the app and you should see all of your apps and flows across all your environments!

Bonus round: Power BI version

If you prefer, I’ve also created a Power BI version of the front-end as well:

As a text-based search is not a native feature within Power BI unless applied to a slicer, I installed the Text Search visual from Microsoft that can be found on AppSource.

You can download the Power BI report template from my GitHub repository and open it using Power BI Desktop to configure.

Similar to the workflow, I have used a couple of parameters for both OneDrive site URL and list name to make it easier to connect to.

Just make sure that when you publish the report to your workspace — that you set it to refresh every night.

Enjoy!

Originally published at Loryan Strant, Microsoft 365 MVP.

--

--

Microsoft 365 MVP, author, cloud guy, thought opinionater, public speaker, distance gazer. Passionate about productivity and life/work balance.