How to get Source Code files for Power Apps Canvas apps

Published Apr 29 2021 03:07 PM 2,224 Views

This post will guide you through the process of how to use the Power Apps Language Toolkit to extract a Power Apps .msapp file. 

 

Why would you want to have the source code files? 

To make your app reusable, so that more people can benefit from it, you will want to share the source code files. Unfortunately, when you save your Canvas App from Power Apps Studio, it is saved in one opaque .msapp file. To be able to get the source files, you will need to use the Power Apps Language Toolkit to extract all files from the .msapp file. This way,

 

  • developers can not only open the source code in their code editor of choice but can effectively manage the code of a Canvas app in GitHub or Azure DevOps. This makes a huge difference as we can't look into .msapp files.
  • makers can still open the .msapp file to easily import an app sample into their environment

Prerequisites

To be able to use the Power Apps Language Toolkit, you will need to

Please note, that command Prompt will open, show a few lines and then close automatically again.
Please also not, that you can now find a bin folder in the local folder you extracted the PowerApps Language Toolkit to. In this bin folder, you will find a Debug folder and inside of the Debug folder you will find a PASopa folder.

 

PASopa-folder.png

Download the .msapp file

  • go to [make.powerapps.com](https://make.powerapps.com)
  • log in
  • open your app in edit mode
  • select File
  • select Save as
  • select This Computer
  • select Download
  • move the downloaded .msapp file to your folder in which you extracted the PowerApps Language Toolkit as well

unpack .msapp file

  • Now that we have the .msapp file of the app:
  • press the WINDOWS key on your keyboard and search for Command Prompt (first few letters should do)
  • run as an Administrator
  • copy the path of the PASopa folder
  •  type in Command Prompt `cd <your PASopa path>`
  • copy the path of the .msapp file
  • create a new folder in your app folder
  • copy the path of that new folder
  • type in Command Prompt `pasopa -unpack <your msappfile path> <new folder path>`

Please note that you will now find all source code files in that new folder. You can open the folder in a code Editor of your choice, for example Visual Studio Code.

 

submit as a sample

Well done! If you like to contribute with your app to the PnP Power Apps sample gallery , you can submit your app with these source code files here. To do so, follow these steps: 

 

Now you can submit these source code files as a sample. Please

 

Please do not forget to provide as well a `README.md` file which explains what your sample is about.

If this all sounds confusing to you and you are new on GitHub - you are more than welcome to attend the Sharing Is Caring sessions, where we guide you through using GitHub and making your first PR. 

 

Sharing Is Caring

%3CLINGO-SUB%20id%3D%22lingo-sub-2308822%22%20slang%3D%22en-US%22%3EHow%20to%20get%20Source%20Code%20files%20for%20Power%20Apps%20Canvas%20apps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2308822%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20post%20will%20guide%20you%20through%20the%20process%20of%20how%20to%20use%20the%20Power%20Apps%20Language%20Toolkit%20to%20extract%20a%20Power%20Apps%20.msapp%20file.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--471458261%22%20id%3D%22toc-hId--471458285%22%3EWhy%20would%20you%20want%20to%20have%20the%20source%20code%20files%3F%26nbsp%3B%3C%2FH2%3E%0A%3CP%3ETo%20make%20your%20app%20reusable%2C%20so%20that%20more%20people%20can%20benefit%20from%20it%2C%20you%20will%20want%20to%20share%20the%20source%20code%20files.%20Unfortunately%2C%20when%20you%20save%20your%20Canvas%20App%20from%20Power%20Apps%20Studio%2C%20it%20is%20saved%20in%20one%20opaque%20.msapp%20file.%20To%20be%20able%20to%20get%20the%20source%20files%2C%20you%20will%20need%20to%20use%20the%20Power%20Apps%20Language%20Toolkit%20to%20extract%20all%20files%20from%20the%20.msapp%20file.%20This%20way%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3Edevelopers%20can%20not%20only%20open%20the%20source%20code%20in%20their%20code%20editor%20of%20choice%20but%20can%20effectively%20manage%20the%20code%20of%20a%20Canvas%20app%20in%20GitHub%20or%20Azure%20DevOps.%20This%20makes%20a%20huge%20difference%20as%20we%20can't%20look%20into%20.msapp%20files.%3C%2FLI%3E%0A%3CLI%3Emakers%20can%20still%20open%20the%20.msapp%20file%20to%20easily%20import%20an%20app%20sample%20into%20their%20environment%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22toc-hId-2016054572%22%20id%3D%22toc-hId-2016054548%22%3EPrerequisites%3C%2FH2%3E%0A%3CP%3ETo%20be%20able%20to%20use%20the%20Power%20Apps%20Language%20Toolkit%2C%20you%20will%20need%20to%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3Einstall%3CA%20href%3D%22https%3A%2F%2Fcode.visualstudio.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20Visual%20Studio%20Code%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3Einstall%3CA%20href%3D%22https%3A%2F%2Fdotnet.microsoft.com%2Fdownload%2Fdotnet-core%2F3.1%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3E%20.NET%20Core%203.1.x%20(x64)%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3Edownload%20the%20Power%20Apps%20Language%20Toolkit%3CUL%3E%0A%3CLI%3Ego%20to%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FPowerApps-Language-Tooling%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Egithub.com%2Fmicrosoft%2FPowerApps-Language-Tooling%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3Eselect%20%3CSTRONG%3ECode%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3Eselect%20%3CSTRONG%3EDownload%20ZIP%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3E%26nbsp%3Bextract%20the%20Power%20Apps%20Language%20Toolkit%20to%20a%20local%20folder%3C%2FLI%3E%0A%3CLI%3E%26nbsp%3Bopen%20that%20local%20folder%3C%2FLI%3E%0A%3CLI%3Elocate%20the%20build.cmd%20file%3C%2FLI%3E%0A%3CLI%3Erightclick%2C%20%3CSTRONG%3ERun%20as%20Administrator%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3Ein%20the%20Pop%20up%20Window%2C%20select%20%3CSTRONG%3Emore%20info%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3Eselect%20%3CSTRONG%3ERun%20anyway%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EPlease%20note%2C%20that%20command%20Prompt%20will%20open%2C%20show%20a%20few%20lines%20and%20then%20close%20automatically%20again.%20%3CBR%20%2F%3EPlease%20also%20not%2C%20that%20you%20can%20now%20find%20a%20%3CSTRONG%3Ebin%3C%2FSTRONG%3E%26nbsp%3Bfolder%20in%20the%20local%20folder%20you%20extracted%20the%20PowerApps%20Language%20Toolkit%20to.%20In%20this%20%3CSTRONG%3Ebin%3C%2FSTRONG%3E%26nbsp%3Bfolder%2C%20you%20will%20find%20a%20%3CSTRONG%3EDebug%3C%2FSTRONG%3E%26nbsp%3Bfolder%20and%20inside%20of%20the%20%3CSTRONG%3EDebug%3C%2FSTRONG%3E%26nbsp%3Bfolder%20you%20will%20find%20a%20%3CSTRONG%3EPASopa%3C%2FSTRONG%3E%20folder.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PASopa-folder.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F277010iF426272EB0CD5C95%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22PASopa-folder.png%22%20alt%3D%22PASopa-folder.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-208600109%22%20id%3D%22toc-hId-208600085%22%3E%3CSTRONG%3EDownload%20the%20.msapp%20file%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3Ego%20to%20%5Bmake.powerapps.com%5D(%3CA%20href%3D%22https%3A%2F%2Fmake.powerapps.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fmake.powerapps.com%3C%2FA%3E)%3C%2FLI%3E%0A%3CLI%3Elog%20in%3C%2FLI%3E%0A%3CLI%3Eopen%20your%20app%20in%20edit%20mode%3C%2FLI%3E%0A%3CLI%3Eselect%20%3CSTRONG%3EFile%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3Eselect%20%3CSTRONG%3ESave%20as%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3Eselect%20%3CSTRONG%3EThis%20Computer%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3Eselect%26nbsp%3B%3CSTRONG%3EDownload%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3Emove%20the%20downloaded%20.msapp%20file%20to%20your%20folder%20in%20which%20you%20extracted%20the%20PowerApps%20Language%20Toolkit%20as%20well%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22toc-hId--1598854354%22%20id%3D%22toc-hId--1598854378%22%3Eunpack%20.msapp%20file%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3ENow%20that%20we%20have%20the%20.msapp%20file%20of%20the%20app%3A%3C%2FLI%3E%0A%3CLI%3Epress%20the%20WINDOWS%20key%20on%20your%20keyboard%20and%20search%20for%20%3CSTRONG%3ECommand%20Prompt%3C%2FSTRONG%3E%26nbsp%3B(first%20few%20letters%20should%20do)%3C%2FLI%3E%0A%3CLI%3Erun%20as%20an%20Administrator%3C%2FLI%3E%0A%3CLI%3Ecopy%20the%20path%20of%20the%20%3CSTRONG%3EPASopa%3C%2FSTRONG%3E%26nbsp%3Bfolder%3C%2FLI%3E%0A%3CLI%3E%26nbsp%3Btype%20in%20Command%20Prompt%20%60cd%20%3CYOUR%20pasopa%3D%22%22%20path%3D%22%22%3E%60%3C%2FYOUR%3E%3C%2FLI%3E%0A%3CLI%3Ecopy%20the%20path%20of%20the%20.msapp%20file%3C%2FLI%3E%0A%3CLI%3Ecreate%20a%20new%20folder%20in%20your%20app%20folder%3C%2FLI%3E%0A%3CLI%3Ecopy%20the%20path%20of%20that%20new%20folder%3C%2FLI%3E%0A%3CLI%3Etype%20in%20Command%20Prompt%20%60pasopa%20-unpack%20%3CYOUR%20msappfile%3D%22%22%20path%3D%22%22%3E%20%3CNEW%20folder%3D%22%22%20path%3D%22%22%3E%60%3C%2FNEW%3E%3C%2FYOUR%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EPlease%20note%20that%20you%20will%20now%20find%20all%20source%20code%20files%20in%20that%20new%20folder.%20You%20can%20open%20the%20folder%20in%20a%20code%20Editor%20of%20your%20choice%2C%20for%20example%20Visual%20Studio%20Code.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-888658479%22%20id%3D%22toc-hId-888658455%22%3Esubmit%20as%20a%20sample%3C%2FH2%3E%0A%3CP%3EWell%20done!%20If%20you%20like%20to%20contribute%20with%20your%20app%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fpnp.github.io%2Fpowerplatform-samples%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EPnP%20Power%20Apps%20sample%20gallery%3C%2FA%3E%26nbsp%3B%2C%20you%20can%20submit%20your%20app%20with%20these%20source%20code%20files%20here.%20To%20do%20so%2C%20follow%20these%20steps%3A%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20you%20can%20submit%20these%20source%20code%20files%20as%20a%20sample.%20Please%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3Efork%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fpnp%2Fpowerapps-samples%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EPnP%20PowerApps%20repository%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3Ecommit%20your%20files%3C%2FLI%3E%0A%3CLI%3EPull%20Request%20by%20filling%20out%20the%20PR%20template%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20do%20not%20forget%20to%20provide%20as%20well%20a%20%60README.md%60%20file%20which%20explains%20what%20your%20sample%20is%20about.%3C%2FP%3E%0A%3CP%3EIf%20this%20all%20sounds%20confusing%20to%20you%20and%20you%20are%20new%20on%20GitHub%20-%20you%20are%20more%20than%20welcome%20to%20attend%20the%20%3CA%20href%3D%22https%3A%2F%2Fpnp.github.io%2Fsharing-is-caring%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ESharing%20Is%20Caring%3C%2FA%3E%20sessions%2C%20where%20we%20guide%20you%20through%20using%20GitHub%20and%20making%20your%20first%20PR.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3ESharing%20Is%20Caring%3C%2FEM%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2308822%22%20slang%3D%22en-US%22%3E%3CP%3ELearn%20how%20to%20use%20the%20Power%20Apps%20Language%20Toolkit%20to%20extract%20.msapp%20file%20and%20get%20the%20source%20code%20files%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22daniel-cheung-TlJNYnCdpAE-unsplash.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F276950iCCDC7DF835613045%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22daniel-cheung-TlJNYnCdpAE-unsplash.jpg%22%20alt%3D%22daniel-cheung-TlJNYnCdpAE-unsplash.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2308822%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EHow%20to%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Apr 30 2021 03:47 AM
Updated by: