While developing solutions in PowerApps or Power Automate we would generally be doing development in the Default (Company) environment. There might be licensing costs associated with multiple environments and hence it may be an issue in getting separate development, QA or UAT environments.
It can be thought of a scenario like having single sql-server with multiple copies of Database, one as Dev and other as QA. Similarly, in power automate we can clone a flow into multiple copies in each solution and name the flows accordingly.
Steps :
Extract the Deployment package using the export option at a solution level: SolutionPackage_1_0_0_1.zip
Unzip the package to local computer and the folder structure shall be as shown:
Delete the folder : environmentvariabledefinitions and its contents (includes sub-folders , json files)
Navigate to the Workflows folder and you shall find a pre existing JSON file , copy the JSON file and paste it in the same folder location.
Rename the copied file by renaming the Flow Name as well replaced the existing GUID with a new GUID (the GUID in the file name should be in Upper Case)
You might use the following URL for GUID generation
GUID-GeneratorModify the customizations.xml file in the location: SolutionPackage_1_0_0_1\customizations.xml
We shall modify the existing Workflows section, i.e will not be copying same section twice (copying over and modifying the copied section seems to be throwing errors) , but instead updating the existing section and the places to be modified are highlighted below (follow the instructions on the CASE (upper/lower) of the GUID as mentioned in the image below) :
Use the lower case GUID as and where applicable and can use the following online resource for the same :
CaseConverter
- Next we shall modify the solution.xml at ~ \SolutionPackage_1_0_0_1\solution.xml
a. Modify the version number
1.0.0.2
b. Update the existing RootComponent , (copying over and modifying the copied section seems to be throwing errors)
c. Remove the entries under:
Create a zip file maintaining the underlying folder structure to generate the updated deployment package
Import the deployment package and you shall find the clones of your flow in the solution
Define separate environment variables in the solution.
For each environment use the corresponding environment variables inside your flow. Disable the flows when not required or delete them as required independently.
This way we can reuse the same environment to point to separate share point locations simultaneously from the same solution.
Top comments (0)