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

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



要查看或添加评论,请登录

Anurag Porwal的更多文章

社区洞察

其他会员也浏览了