Just a friendly reminder, its a good idea to review the impact any changes to ensure they do not break your code.
Power Apps Studio does not offer any way to make a mass edit but in VS Code you can use the Replace In Files feature (Edit > Replace In Files) to get the job done. I suffer from variable naming regret in every app I’ve ever made. #3 Replace Variable Names Across The Entire App If you only want to find where the collection was initialized look for Collect(collectionName. Searching for the collection name will retrieve all of its uses. VS Code can help you find all occurrences of a collection with the Find In Files feature (Edit > Find In Files). Power Apps Studio has an excellent tool for finding where variables are being used in your code but nothing for collections. I recommend changing the syntax highlighter to C# when reading Power Apps code to make it more easily readable. This makes it quick to look for opportunities to improve coding patterns and whether style properties are using variables or are hardcoded. Let’s look at some real-world examples on why you’ll want to check it out.Ĭonducting a code review on a YAML file allows you to see all of the code on a screen without having to click on each individual control.
Its cool to see the underlying code for a canvas app but that’s not a good enough reason for most folks to download the tool. What Useful Things Can I Do With The Power Apps Source Tool? A majority of the files are in YAML format to make them human readable. Src – source code for screens, components and themes. You can easily copy the files from here for use in other projects.Ĭonnections – connection references for datasources.ĭatasources – datasource definitions including collections and sample dataĮntropy – files needed to pack and unpack the app. The most useful code is found in the Src folder (which is an abbreviation for source).Īssets – contains pictures, videos and music added to the app. Below is a short description of each folder’s purpose. The MSAPP file gets unpacked into several folders. Now I all of the code I wrote in Power Apps Studio can be reviewed in my VS Code editor! …and below you can see what happens when I execute it. Here’s what the actual command I wrote looks like… pasopa -unpack C:\Users\mdevaney\Downloads\MyApp.msapp C:\VSCode\sourcecodedemo Pasopa -unpack PathToMsApp\FromApp.msapp ToSourceFolder
Fortunately April Dunham has created an awesome Youtube video with step-by-step instructions on how to do it. The tool is still experimental so installing it is not as simple as downloading and running an installer. #5 Count The Number Of Controls #6 Store Power Apps Code In A Github Repo Source Code To MSAPP File Final Verdict And Future Possibilities Bonus Tip: Set An Environment Variable #4 Compare Two Files From Different Versions
#2 Find Where Collections Are Being Used #3 Replace Variable Names Across The Entire App
Install the Power Apps Source Code Tool View The Source Code Of An MSAPP File Understanding The Structure Of An App What Useful Things Can I Do With The Power Apps Source Code Tool? In this article I will review the Power Apps source code tool, explain its purpose and tell you why its worth checking out. Not only can you do things like conduct a code review using flat files or check your code into source control, there is also the ability to perform tasks Power Apps Studio cannot such as replacing variable names across the entire app.
I’ve spent the past month playing with the Power Apps source code tool and discovering all of the exciting new possibilities it presents for canvas app developers.