Using Visual Studio Code PAC to change Connection References in bulk

Those times you need to change connection references in 20 Flows and you go oh no! First in the solution in dev, create the new connection references or bring them into the solution.

Then, export the unmanaged solution to your local machine. Put the unmanaged solution file in a nice folder, I go for C:/temp as it’s shorter to type in the console later and is a transitory folder.

Go into VSC and open up a terminal. (First of course, install the PAC functions).

In the VSC shell, go to the temp folder by typing cd c:\temp and do a ls (list), and ensure your zip file is there. Now type :

pac solution unpack –zipfile .\MySolutionApp_1_0_0_1.zip

This will create a number of folders depending on the contents of the solution. The customizations.xml holds all the connection references in the solution, and the Workflows contains all the Flows.

So assuming we want to change a connection reference from one to another. There are two fields per connection to care about:

  1. The logical name : connectionReferenceLogicalName
  2. The Display Name : connectionreferencedisplayname

Do a ‘replace in files’ (CTRL+SHIFT+H) and put in the old connectionreferencelogicalname and the new. Both should be in Customization.xml if you had already created the new references in the solution.

Then remove the old references from customizations.xml if you wish.

Go into Solution.xml and increment the Version to the next one desired.

<Version>1.0.0.1</Version>

Close all the open files, and go back to the terminal, and type:

pac solution pack –zipfile .\MySolutionApp_1_0_0_2.zip

I prefer to put the contents in a new solution but you can overwrite the old by incrementing the version number. When done, remember to wipe the extracted contents of the temp folder.

Now go to make.powerapps.com and import in your solution.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s