Reusing Power Apps Forms Across SharePoint Sites

Introduction

Reusing customized Power Apps forms across different SharePoint sites can streamline your workflow and maintain consistency across your applications. Here’s a comprehensive guide on how to achieve this.

Create a Power App from a SharePoint List

To start, you need to create a Power App from a SharePoint list that you want to customize. Follow these steps.

  • Navigate to your SharePoint list.
  • Click on Integrate in the command bar.
  • Select Power Apps and then Customize Forms.
  • This will open Power Apps Studio where you can design your form.

Save and Publish Your Customized Form

Once you have customized your form,

  • Click on File in Power Apps Studio.
  • Select Save and then Publish to SharePoint.
  • This makes your customized form available to users of the SharePoint list.

Export the Customized Form

Reuse the customized form on another SharePoint site.

  • In Power Apps Studio, go to File > Export package.
  • Choose the components you want to include in the package.
  • Click Export to download the package as a .zip file.

Open the Zip File

After exporting, follow these steps to modify the package.

  • Open the .zip file you just downloaded.
  • Navigate to Microsoft.PowerApps\apps\(some number type folder)/ and locate the file.
  • Open the file in an editor (such as Notepad or Visual Studio Code).
  • Search for the following identifiers: siteId, listId, and listUrl. You will need to change these values to match your new SharePoint site.

Change the following.

  • siteId: The ID of the SharePoint site where you want to import the form.
  • listId: The ID of the list you want to connect to. You can find this by going to Settings > List Settings. In the URL, you will see something like %7******%7D.
  • listUrl: This is the web address of the list, which you can find in the list settings.

Import the Customized Form to Another SharePoint Site

To import the customized form into a different SharePoint site.

  • Navigate to the target SharePoint site.
  • Go to Power Apps > Apps.
  • Click on the Import Canvas app.
  • Upload the .zip file you exported earlier.
  • Follow the prompts to complete the import process. Make sure to change the name, as the name of the form may already exist.

Adjust Connections and Data Sources

After importing, you may need to adjust the connections and data sources.

  • Open the imported app in Power Apps Studio.
  • Go to Data in the left pane.
  • Ensure that all data connections are correctly set up for the new SharePoint site according to your new list, and then save the form.

Publish the Imported Form

Finally, publish the imported form,

  • Click on File > Save and then Publish.
  • Your customized form is now ready for use on the new SharePoint site.

Note. You may encounter errors during the import process if the name of the .zip file is changed or if there are issues with the list ID. If you can't resolve these issues, please contact me through C# Corner or email me at [email protected].

Additional Tips

  • Component Libraries: Consider using Power Apps component libraries to create reusable components that can be shared across multiple apps.
  • Documentation: Maintain documentation for your forms to help users understand how to use them effectively.

Conclusion

By following these steps, you can efficiently reuse customized Power Apps forms across different SharePoint sites, ensuring consistency and saving time in your development process.