Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Triggers
  • Resources
  • ABOUT ME
  • Get help with your flow
Menu

Reconnect Power Automate flow to a different SharePoint site/lists

Posted on July 23, 2023July 23, 2023 by Tom

“I’d like to reuse my Power Automate flow on a different SharePoint site, is there some easy way how can I reconnect all the lists without updating all the actions one by one?”


When you build Power Automate flows, the right approach should be to have two environments. One where you’ll develop the flow and do all the testing, and a second one for the final flow. If it’s a flow connected to SharePoint, it might be two SharePoint sites. One with testing data, another one with the production data. Only properly tested flows should make it to the production data.

Yet if you are building flows over SharePoint, all the actions will be connected to the development site (unless you use solutions, topic for some post in the future). Moving them to the production site might need an update in all the SharePoint actions. A task that’s quite risky – what if you miss one of the actions? And how annoying it might be to update site and list/library in tens of actions? Is there an easier way to reconnect everything in the flow to a different site?

Start by exporting the flow

You can’t make any mass updates directly using the flow designer, but you can do it directly in the flow code. Start by exporting the flow in a .zip package.

Enter some name for the exported file and export it.

Open the flow definition file

Once downloaded, extract the .zip file and go deep into the folder structure until you get to the definition.json file.

Power Automate different SharePoint site

Open it in a code editor (I personally use Visual Studio Code) and you’ll see the original site url and list guid in the code.

Power Automate different SharePoint site

This tells the flow where to connect, and that’s the part where you can reconnect the flow. But to get that you’ll need guid of all the lists and libraries on both of the sites. Copy/paste all the guids into a text file.

Now you can start replacing the values in the definition.json files, the old url with the new one, the old guid with the new one.

Power Automate different SharePoint site

Replace the file in the .zip file

After you replace all the guids, replace the definition.json file in the .zip file with the new one.

Note: you’ll have to do this in Windows as Mac OS adds an additional folder in .zip files that makes the flow .zip file invalid.

Import the new flow

Import the flow again using the updated .zip file. Go to the flows overview and select Import -> Import Package.

Select the .zip file, pick the connections it should use, and import it.

The imported flow will be connected to the new SharePoint site, lists, and libraries.

Summary

It might be time consuming to reconnect Power Automate flows to a different SharePoint site if you use the designer. Luckily, you don’t have to. You can download the flow as a .zip file, find the connections in the definition.json file and replace them, and import the flow again. Instead of replacing sites/lists/libraries one by one you can replace multiple at once with the editor ‘replace all’ functions. The only challenging part might be to not get lost in all the guids, but if you store them in an organised way you should be fine.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

1 thought on “Reconnect Power Automate flow to a different SharePoint site/lists”

  1. James says:
    August 21, 2023 at 12:09 am

    Love your stuff Tom! But this feels like a case of just because we can doesn’t mean we should … Solutions and Environment variables would likely be faster as well, looking forward to that post 🙂

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


There's also the HTTP requests to SharePoint cheat sheet to help you overcome limitations of some standard actions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with 1000s of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes