How to find all associated Power Automate Flows for a SharePoint?

Step By Step solution

Step #1 First, create a Manually Triggered Power Automate Flow.

Step #2 Add “Sent an HTTP request to SharePoint” action

We will run this flow to all list and libraries that are present in site, this step will get the all the list and libraries details list GUID and Title etc.

Step #3 Filter the JSON result from above HTTPS result

Here, we are excluding all the hidden lists and libraries.

From: body('Get_All_List_and_Libraries_that_are_present_in_our_site')?['body']?['d']?['results']

Step #4 Select the List DisplayName(Title) and List GUID

Step #5 Next Step is Apply to each

This Apply to each action loop through all the lists and libraries are non-hidden in site

Step #5.1 Send HTTPS Request to get the flow details related to specific list/library

URI: _api/web/lists/getbytitle('@{replace(items('Apply_to_each')?['ListName'],'''','''''')}')/SyncFlowInstances

Headers: {
  "accept": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose"
}

The above call returns a response in the FlowSynchronizationResult. The intent now will be to get the data from the FlowSynchronizationResult.SynchronizationData property. This property stores value as JSON string as seen in the below sample data.

{
  "d": {
    "__metadata": {
      "id": "https://BLAHBLAH.sharepoint.com/sites/siteprovisioning-preprod/_api/web/lists/GetByTitle('MasterSiteInventory')/SyncFlowInstances",
      "uri": "https://BLAHBLAH.sharepoint.com/sites/siteprovisioning-preprod/_api/web/lists/GetByTitle('MasterSiteInventory')/SyncFlowInstances",
      "type": "SP.FlowSynchronizationResult"
    },
    "SynchronizationData": "{\"value\":[{\"name\":\"1a7", REMOVED FOR BREVITY"
    "SynchronizationStatus": 0
  }
}

Step #5.2 Storing List Name and GUID into compose action

Step #5.3 converting JSON String into JSON Object

Here we are converting JSON string which have the information about flow list Flow ID and Flow Name into JSON Object, so later we can extract information from this object

json(outputs('Send_an_HTTP_request_to_SharePoint_3')?['body']?['d']?['SynchronizationData'])?['value']

Step #5.4 Retrieve Flow name and Flow ID from JSON Object that we created in previous step

From: outputs('Compose_2')

Map: {
  "Flow ID": @{item()?['name']},
  "Flow Name": @{item()?['properties']?['displayName']}
}

Step #5.5 Storing Flow ID and Flow Name information into Array Variable

Value: {
  "Flow ID": "@{items('Apply_to_each_2')?['Flow ID']}",
  "Flow Name": "@{items('Apply_to_each_2')?['Flow Name']}",
  "Associated List Name": "@{outputs('Compose_4')}",
  "Associated List GUID": "@{outputs('Compose_5')}"
}

Step #6 Showing the flow details in compose action

About the Author:

Anurag Porwal

As a Software Associate, I develop SharePoint and Power Apps solutions that enhance the productivity and efficiency of various users and clients. I have over 3 years of experience in installation, administration, maintenance, and development of SharePoint and Power Apps solutions, using tools such as Power Automate, Power BI, SPFx, Canvas Apps, and PCF.

I have delivered multiple POCs, reports, forms, and reusable components that have been used and appreciated by many employees and clients. I have also demonstrated my skills in Graph API, REST APIs, and Microsoft 365 tools and connectors. I have received recognition and appreciation for my work from my organization and clients. I graduated with a Bachelor of Technology in Computer Science from University of Petroleum and Energy Studies in 2021, and I hold certifications in Power Platform Fundamentals (PL900) and PL100. I am motivated by learning new technologies and solving complex problems. I value collaboration, innovation, and quality in my work.

Pause
Reference:

Porwal, A (2024). How to find all associated Power Automate Flows for a SharePoint? Available at: (1) How to find all associated Power Automate Flows for a SharePoint? | LinkedIn [Accessed: 26th September 2024].

Share this on...

Rate this Post:

Share: