Power App: How to export and import a SharePoint Power App Form

At this moment there is no out-of-the-box way to export/import a SharePoint Power App form between SharePoint list. Even when you duplicate the SharePoint List the custom SharePoint Power App form will not be duplicated. But fear not, there is a way to transfer the form. However its not for the faint of heart you will need to manual edit the forms code.

Exporting the form

  • Open the settings of the SharePoint list with the SharePoint Power App form.
  • Click on Form settings.
  • Click on See versions and usage; this will open the app in the Power App Studio.
  • Click on Export package.
  • Give the package a name and set the import setup to Create as new.
  • Click on Export.

Duplicate the SharePoint list

We will need a exact copy of the original SharePoint list, otherwise the names (references) will not be the same.

  • Click in SharePoint on the menu on the left on the +
  • Click on Existing list
  • Select the SharePoint site and the select your list, my list is called My Demo List.
  • Leave the name the same and click on Create.
  • A duplicated list is now created, but without the SharePoint Power App form.
  • For the manual changes we will need to get the list id
  • Open de list settings and copy the list ID from the URL.

Manually changing the references

  • Navigate to the exported SharePoint Power App form create a copy of it and unzip it.
  • Open the unzipped folder.
  • Navigate to Microsoft.PowerApps – Apps – [numeric value].
  • Open the JSON file with only numbers in its name in your favorite code editor (I am using Visual Studio Code).
  • Find the old list id and replace it with the new ID. Depended on you app, the ID might need to be replaces multiple times.
  • Now find the site URLs that reference the old site and change them to the new site. There might be multiple URLs that need to be updated, my app had 5.
  • Save the changes to the file.
  • Now we need to unzip the MSAPP File.
  • Change the type from msapp to zip and unzip the folder.
  • Open the unzipped folder.
  • Open the Properties.json and change the old URL to the new URL.
  • Open the DataSources file.
  • Change al the old URLs to the new URL, be aware there are some partial URLs that need to be changed.
  • Save all the changes and remake the zip file.
  • Remove the old MSAPP file.
  • Rezip the folder and set the name to be exactly the same as the old msapp file.
  • Make sure you did not add an extra folder layer to the new zip file.
  • Change the file type of the zip file to msapp.
  • Remove the unzipped folder.
  • Go to the top level of the folder and rezip the whole app.
  • Make sure you did not add an extra folder layer to the new zip file.

Importing the form

  • Upload the updated exported package (zip).
  • Change the name of the app, the names of app need to be unique.
  • If required setup the connections.
  • If required select the flows.
  • Click on import.
  • Wait for the import to finish.
  • Open the new (duplicated) SharePoint list.
  • Click on Integrate – Power Apps – Customize forms.
  • This will open the imported app.
  • Publish the app.
  • Go back to the list and create an item, the SharePoint Power App form will now be opened.
    • You might need to refresh the page for the app to appear.