The need to move a PowerApps solution from deployment to the production environment is nothing new to those who work with PowerApps. The problem is that currently, there is no out-of-the-box solution that can perform this currently. This limitation causes many reworks, costing a lot of work hours for a developer. Secondly, if an extensive application is being developed again, there is always a chance for some bugs to appear. These bugs then call for another QA session, which requires a lot of effort.
In this blog, we will show you a solution that is designed to combat all these issues. Using this method, you can export and deploy the same application in a production environment without hassle.
Step 1: Create a list on Production Environment.
Important: The name of the list and all the columns should be the same as the development environment.
Pro Tip: One great way to create the production list the same as the development environment would be to create a list via the “From existing list” option where you can select source site and list name, and the resulting list would be the same. Caution: This only works when you are migrating within a tenant.
Step 2: Export PowerApps Solution
Once the list on the destination site is ready, we can begin with the migration. First, open the source application in PowerApps, and navigate to the options menu. Then click on “See all versions”.
On the next screen, select the “Export Package” button on the top.
The next page will require some basic information regarding the Package (like package Name etc.). Also, the Import Setup would be set by default to Update, change that to “Create as New.”
Next, click on the settings icon, set that to “Create as New.” Finally, click on the “Export” button at the bottom, and a zip file will be downloaded into your system.
Step 3: Make changes in PowerApps
Once the App package is downloaded; extract the file. In the extracted folder, move to Microsoft.PowerApps -> apps -> 1549133250558238xxxxx. Open the 1549133250558238xxxxx.json file in Notepad.
Under embeddedApp, please provide the following details:
- Replace “siteId” with the site Id of the destination site.
- Replace “listId” with the list id for the destination list. Hint: While you are in List Settings, it is appended in the URL (between %7B and %7D).
- Replace “listUrl” with the URL of the list.
Save the JSON file and replace the original file in ZIP with this newly created JSON file.
Step 4: Import PowerApps
Navigate to make.powerapps.com. From the left menu, select Apps, and then on the top select “Import Canvas App”. On the next screen, upload the zip file with the changes we made in the last step. Once the import is complete, navigate to the destination list and click on the customized form. When the PowerApps loads, it will be the same as the source PowerApps solution. All you need to do is publish it.
The PowerApps form is now associated with the list and clicking New or any item in the list would open the PowerApps form. (If for some reason it does not show, please check if the PowerApps form is selected in List Settings -> Form Settings)
Step 5: Set the connections to the right lists.
Lastly, the connections in the list need to be updated to the new list as they will still be pointing to the old links. Update them and Publish the App again.
Step 6: Test the app and you are done.
Now, test the app by creating a new record. Congratulations, you have saved many hours of your workday!
Conclusion
This blog showed how a tedious task such as migrating a PowerApp from your development environment to production environment could be optimized using a few tricks. Not only does this save a lot of work, but it is also significantly less prone to errors. So, try this solution on your next deployment and let us know how it went in the comments!