For most Custom Forms, that are created on SharePoint lists using Power Platform, it is sufficient to use the versioning of Power Apps itself. This allows you to quickly and easily undo unwanted modifications and restore the version you want your users to see.

However, there are now SharePoint custom forms in many companies that have become business-critical. SharePoint Custom Forms can only be created in a Default Environment, which means we cannot use the different security mechanisms of Custom Environments. Therefore it is good to have a way to store them in a versioning tool. It’s better to be safe than sorry, right?

Without further ado, here is the good stuff:

How to access the build in version of a custom form

  1. To view the versioning in Power Apps, simply access the SharePoint List Settings: Open SharePoint list settings
  2. Within the General Settings, the Form Settings are listed as the last option: Open SharePoint list form settings
  3. From here, you can access the available versions of the custom form: Open SharePoint list form version settings
  4. Now click the Versions tab to see all the versions of the custom form: Open SharePoint list form version settings This is a simple way to view, restore or delete the different versions of the custom form. But as you can see in the screen above, only versions younger than 6 months are saved.

How to export custom form as a package

In order to save versions beyond that limit of 6 months, or to store the Custom Form in a version control tool, the export function can be used.

Not to repeat myself, just follow the introduction from the last chapter.

  1. Click on Export package to get to the Export Screen: Click on export package
  2. Now the package must be created, and for this we need an appropriate name. My recommendation for a naming convention is: SC[Title of Site Collection]_List[Title of List]_CustomForm. In addition, the Import Setup must be set to Update. Screen export package
  3. After clicking Export, a zip file will be created and downloaded.

You can now check in or save the zip file into a source control tool of your choice. What’s even cooler, is that the zip file contains a .msapp file that can be modified via the Power Platform CLI. This unlocks real scource control capabilites and other nice possibilities.

Word of warning

Before starting the import of the package, a word of warning: In order to import the package, the current version of the custom form must be deleted. So, you should be sure that the default version control does not include the version you want. In addition, for business-critical forms, recovery testing should always be performed to ensure that the applied solution works.

How to restore custom form to a SharePoint list

That being said, the package can now be re-imported if necessary.

  1. First, the current package must be deleted. To perform this, the Form Settings of the list must be opened (see step 1 & 2 for this).
  2. Now change the setting to “Use the default SharePoint form”. Change to SharePoint default form
  3. After the option is selected, the “Delete custom form” option appears and can be clicked: Delete SharePoint custom form
  4. Then, in the Power Apps Maker portal, the package must be uploaded via “Import canvas app”: Import in Maker Portal
  5. Now the correct version of the custom form can be uploaded as a zip file.
  6. On the “Import Package” screen, click on the displayed setup option: Setup settings
  7. This now is the important part: Change the setup to “Create as new” and give it a unique resource name. Save your settings and click on “Import”: Setup fly out
  8. Once the import is finished, you need to switch back to “Use as custom form created in Power Apps” in the SharePoint Settings. Change Form settings once again Hint: If the option is not immediately available, simply refresh the browser.
  9. Click on “Modify form in PowerApps”, change one property in the app (for example the colour), save and publish it. Modify and publish app

Summery

As you can see, it is possible to backup, import and even post-process SharePoint Custom Forms outside of Power Platform. However, I believe that this method is only for a few exceptions and when it is really critical to have a backup. Primarily, because you import the backup after you have deleted the original. Therefore, I also see it as essential to test this method before using it.