Skip to content

Power Apps - Upgrade custom form

  1. Create a root folder for the upgrade / sync of a SharePoint Power Apps Custom Form
  2. Export and unpack the DEV package of the custom form List > List Settings > Form Settings > Use a custom form created in Power Apps > See versions and usage > Export Package Name: DEV > Export Download and move to orginalpackages folder, unzip to .\DEV
  3. Export the PRD package of the custom form List > List Settings > Form Settings > Use a custom form created in Power Apps > See versions and usage > Export Package Name: PRD > Export Download and move to orginalpackages folder, unzip to .\PRD
  4. Unpack development App and production App CD <root folder for the upgrade> Get-ChildItem .\dev\*.msapp -Recurse | ForEach-Object {pac canvas unpack --msapp $_ --sources .\devmsapp} Get-ChildItem .\prd\*.msapp -Recurse | ForEach-Object {pac canvas unpack --msapp $_ --sources .\prdmsapp}
  5. Copy DEV yaml over the PRD yaml and package copy ".\devmsapp\Src\FormScreen1.fx.yaml" ".\prdmsapp\Src" Find replace connection reference in FormScreen1.fx.yaml Get-ChildItem .\prd\*.msapp -Recurse | ForEach-Object {pac canvas pack --sources .\prdmsapp --msapp $_}
  6. CD <root folder for the upgrade>\PRD [CTRL]+A Compress to zip file (.\prd\manifest.zip)
  7. Remove PRD custom form List > List Settings > Form Settings > Use the default SharePoint form List > List Settings > Form Settings > Delete custom form > OK
  8. Import PRD package Power Apps Maker > Apps > Import Canvas App > .\prd\manifest.zip Action > Create as New > Save
  9. Update custom form and publish List > List Settings > Form Settings > Use a custom form created in Power Apps > Modify Form in Power Apps remove datasource and add datasource > Save > Publish

Gescript:

<#
This script assumes 2 exported canvas zip files downloaded from a dev library (DEV.zip) and from it's prd library (PRD.zip)
Running this script it will
- extract these zipped files
- unpack the canvas app in the files
- overwrite the PRD FormScreen1.fx.yaml file with the one of the DEV
- pack the PRD canvas app
- zip the PRD solution to PRD_Deploy.zip

Standard Operational Procedure
1. DEV List > List Settings > Form Settings > See versions and usage > Export package > Name: DEV > Export
2. Copy generated DEV_99999999.zip to this folder and rename to DEV.zip
3. PRD List > List Settings > Form Settings > See versions and usage > Export package > Name: PRD > Export
4. Copy generated PRD_99999999.zip to this folder and rename to PRD.zip
5. Run this script
#>
Expand-Archive .\DEV.zip -DestinationPath dev
Expand-Archive .\prd.zip -DestinationPath prd
Get-ChildItem .\dev\*.msapp -Recurse | ForEach-Object {pac canvas unpack --msapp $_ --sources .\devmsapp}
Get-ChildItem .\prd\*.msapp -Recurse | ForEach-Object {pac canvas unpack --msapp $_ --sources .\prdmsapp}
Copy-Item ".\devmsapp\Src\FormScreen1.fx.yaml" ".\prdmsapp\Src"
Get-ChildItem .\prd\*.msapp -Recurse | ForEach-Object {pac canvas pack --sources .\prdmsapp --msapp $_}
Compress-Archive .\prd\* -DestinationPath PRD_Deploy.zip
Remove-Item -LiteralPath "dev" -Force -Recurse
Remove-Item -LiteralPath "devmsapp" -Force -Recurse
Remove-Item -LiteralPath "prd" -Force -Recurse
Remove-Item -LiteralPath "prdmsapp" -Force -Recurse
<#
6. PRD List > List Settings > Form Settings > Use the default SharePoint form > Delete custom form
7. make.powerapps.com > Apps > Import canvas app > Choose package file to import: PRD_Deploy.zip
8. Import setup: Create as new > Import
9. PRD List > List Settings > Form Settings > Modify custom form > Update reference names (only if DEV and PRD have different names) > Save > Publish

Form is deployed / copied to production list
#>