question

ATG-5876 avatar image
0 Votes"
ATG-5876 asked ATG-5876 answered

How to find flows in a site

what is the best way to find out what flows are associated to a site. I have users saying that their flow is not working but there is no way for me to see the flows through the site. what is the best way to get to the flow in order to troubleshoot it?

Regards,

office-sharepoint-online
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AllenXu-MSFT avatar image
0 Votes"
AllenXu-MSFT answered AllenXu-MSFT commented

Hi @ATG-5876 ,

You have to ask your users to find those issue flows and share flows with you, otherwise you will have no access to those flows even if you are a SharePoint Online site administrator.
121874-image.png
Then you can find the issue flows under "Shared with me".
121894-image.png

===================Updated===================
@ATG-5876 ,

We can find Power Automate Flows that are connected to your site using CLI for Microsoft365. The CLI for Microsoft 365 is distributed as an NPM package. To use it, install it globally using:

 npm i -g @pnp/cli-microsoft365

Then run the below script:

 Write-Output "Retrieving all environments"
    
 $environments = m365 flow environment list -o json | ConvertFrom-Json
 $searchString = "https://contoso.sharepoint.com/sites/mysite";
 $path = "exportedflow.json";

 ForEach ($env in $environments) {
     Write-Output "Processing $($env.displayName)..."
    
     $flows = m365 flow list --environment $env.name --asAdmin -o json | ConvertFrom-Json
    
     ForEach ($flow in $flows) {
         Write-Output "Processing $($flow.displayName)..."
         m365 flow export --id $flow.name --environment $env.name --format json --path $path
    
         $flowData = Get-Content -Path $path -ErrorAction SilentlyContinue
    
         if($null -ne $flowData) {
             if ($flowData.Contains($searchString)) {
                     Write-Output $($flow.displayName + "contains your search string" + $searchString)
                     Write-Output $flow.id
             }
    
             Remove-Item $path -Confirm:$false
         }
     }
 }

Executing the script provides you a list of all flows that contains your search string.

However I don't think list those flows will help you to troubleshoot. You will get a list of all flows but we have no way to know which one(s) is the issue flow. You just get the names of all flows, you still have no access to those flows and configure those flows.


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


image.png (26.2 KiB)
image.png (13.1 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you, @AllenXu-MSFT. So, there is no way to query a site (PowerShell, etc.) to see what flows or PowerApps maybe configured for the site?

0 Votes 0 ·

@ATG-5876 ,

I have updated my answer above, please take a reference to it.

0 Votes 0 ·
ATG-5876 avatar image
0 Votes"
ATG-5876 answered

Thank you, appreciate the info.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.