SharePoint  

Migrating SharePoint Customized List Form to a Standalone Power App (Using “Copy Code” Method)

Introduction

Many organizations start with customized SharePoint list forms created directly in Power Apps. These forms work great initially, but quickly hit limitations when you need advanced logic, complex navigation, or integration with multiple lists.

There’s No Direct Import/Export Path Between SharePoint Forms and Standalone Power Apps.

The Core Reason

When you customize a SharePoint list form using Power Apps , it’s not a regular Power App stored in your environment. Instead, it’s embedded inside SharePoint and tied to a specific list through a special component called:

"SharePointIntegration"

This hidden control manages:

  • The communication between SharePoint and Power Apps

  • Form mode (New/Edit/View)

  • Item context (which record you’re editing)

So, unlike a normal app, it:

  • Doesn’t have a visible App.OnStart

  • Doesn’t support Navigate() for multi-screen apps

  • Can’t be exported/imported as a reusable .msapp

  • Isn’t listed in the Power Apps environment under “Apps”

That’s why there’s no official or direct method to import/export between the two.

The most stable way to migrate today is by using the Copy Code method instead of exporting .msapp files.

Why “Copy Code” Instead of Export/Import?

Issue with Export/ImportBenefit of Copy Code
Alignment breaks after importLayout preserved better
Data sources become invalidYou can re-add them manually with full control
Screen scaling changesPasting code into a blank app gives flexibility
Old form references ( SharePointIntegration ) remainclean app structure without hidden dependencies

Step of Migration Using “Copy Code”

Step 1. Open Your Customized List Form

  1. Open your SharePoint list → Integrate → Power Apps → Customize forms

  2. Once it opens in Power Apps Studio, go to:
    File → Settings → Upcoming features → Enable "Power Apps View Code" (Preview)

  3. Return to the editor and click on View Code (on top right).

Step 2. Copy the App Code

  1. In the Code view , click Copy All

  2. This copies the entire Power Fx structure (screens, controls, properties, formulas)

  3. Keep this copied text in your clipboard — or paste it temporarily into Notepad

Screenshot 2025-10-31 182041

Screenshot 2025-10-31 182104

Step 3. Create a New Blank Canvas App

  1. In Power Apps → Create → Canvas app → Blank (Tablet/Phone)

  2. Once created, go to App → View Code in this new app

  3. Delete the existing code and paste your copied code here

You’ll now have the same UI, controls, and logic inside a standalone app environment.

Screenshot 2025-10-31 193131

Step 4. Add Data Sources Manually

Since SharePoint list bindings are not automatically carried over, re-add them manually:

  1. Go to Data → Add data → SharePoint

  2. Select the site and lists you used in the original form

  3. Update form DataSource and control Items properties, for example:

  
    // Example for form
EditForm1.DataSource = 'Leave Requests'

// Example for dropdown
DepartmentDropdown.Items = Choices('Leave Requests'.Department)
  

Step 5. Add OnVisible Property to Form Screen

When moving to a standalone app, SharePointIntegration no longer handles context — you must handle screen initialization yourself.

Go to your form screen → select OnVisible property → add this logic:

  
    // Initialize user
Set(varUser, User());

// Load SharePoint list data
ClearCollect(colRequests, 'Leave Requests');

// Determine mode (New/Edit/View)
If(
    !IsBlank(Param("ID")),
    EditForm(EditForm1);
    Set(varCurrentItem, LookUp('Leave Requests', ID = Value(Param("ID")))),
    NewForm(EditForm1)
);

// Initialize screen-level variables
UpdateContext({varShowSuccess:false});
  

Step 6. Add App.OnStart Property

In standalone apps, you can define global settings here:

  
    // Global theme
Set(varPrimaryColor, RGBA(0,120,212,1));
Set(varBgColor, RGBA(240,240,240,1));

// Load admin list or environment configs
ClearCollect(colAdmins, ["[email protected]"]);
Set(varIsAdmin, User().Email in colAdmins);
  

Step 7. Validate Navigation and Form Modes

Since standalone apps use their own navigation (not SharePointIntegration), check:

ScenarioExpected BehaviorExample
New recordOpens empty formNewForm(EditForm1)
Edit recordOpens prefilled recordEditForm(EditForm1) + Set(varCurrentItem, LookUp(...))
View recordRead-only viewViewForm(EditForm1)

Migration Checklist (Copy Code Method)

StepDescriptionStatus
1Open the SharePoint customized form
2Enable “View Code” and copy all
3Create a new blank Canvas App
4Paste the copied code into the new app
5Add SharePoint data connections
6Rebind data source and controls
7Add OnVisible property
8Add App.OnStart logic
9Validate New/Edit/View navigation
10Publish and test

Pro Tips

  • Save the copied code as a backup in a text file ( AppCode_Backup.txt )

  • Use containers to fix layout issues quickly after migration

  • Adjust screen sizes (App settings → Display → Orientation)

  • Use collections ( ClearCollect ) to preload data and reduce delays

  • Maintain a version log using App.Version and a SharePoint list

Conclusion

The Copy Code method offers a faster, cleaner, and more reliable path to migrate your SharePoint form into a full Power App. Unlike export/import, it avoids alignment issues and legacy bindings — giving you a standalone, maintainable, and scalable app.