Skip to content

How to submit a Power App sample

Hugo Bernier edited this page Apr 30, 2021 · 11 revisions

This post will guide you through how we can best accept your sample contribution for the Power Apps gallery.

Why

To make your app reusable, so that more people can benefit from it, we 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

  • Install Visual Studio Code
  • Install .NET Core 3.1.x (x64)
  • Download the Power Apps Language Toolkit
  • Extract the Power Apps Language Toolkit to a local folder
  • Open that local folder
  • Locate the build.cmd file
  • Using the contextual menu (i.e.: Right-click), select Run as Administrator
  • In the Pop-up Window, click more information
  • Select Run anyway

Please note, that the command prompt will open, show a few lines and then close automatically again.

Please also note, 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.

Download the .msapp file

  • Go to 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:

  • Use the WINDOWS key on your keyboard and search for Command Prompt (the first few letters should do)
  • Run as an Administrator
  • Copy the path of the PASopa folder
  • Using the command prompt, enter 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
  • Using the command prompt, enter 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.

Create the folder structure

Create a folder matching the name of your sample under the samples folder.

The sample folder should contain the following folder structure:

  • assets - where you'll put the screenshots for your sample.

    We'll also add a sample.json which will contain the metadata for the samples gallery -- but don't worry about creating it, we'll take care of it.

  • sourcecode - this is where you'll put the unpacked source code. It will most likely contain the following folder structure (which may change, depending on the version of the tool)
    • \src - the control and component files. This contains the sources.
      • *.pa.yaml - the formulas extracted from the control.json file. This is the place to edit your formulas.-
      • CanvasManifest.json - a manifest file. This contains what is normally in the header, properties, and publishInfo.
      • *.json - the raw control.json file.
      • \EditorState*.editorstate.json - cached information for Studio to use.
    • \DataSources - all data sources used by the app.
    • \Connections - connection instances saved with this app and used when reloading into studio.
    • \Assets - media files embedded in the app.
    • \pkgs - A downloaded copy of external references, such as templates, API Definition files, and component libraries. These are similar to nuget/npm references.
    • \other - all miscellaneous files needed to recreate the .msapp
      • entropy.json - volatile elements (like timestamps) are extracted to this file. This helps reduce noisy diffs in other files while ensuring that we can still round trip.
      • Holds other files from the .msapp, such as what is in \references

NOTE: When merging the pull request, we'll pack the source code and generate a .msapp file. We'll place it in the solution folder.

Adding screenshots

People should be able to tell how awesome your sample is without having to download it and install it.

That's why we use screenshots.

Please provide at least one high-quality screenshot of your Power App and place it in your sample folder's assets folder . If possible, use a resolution of 1920x1080 -- or an aspect ratio of 16:9. You can add as many screen shots as you'd like to help users understand your sample without having to download it and install it.

If you feel fancy, you can even add an animated .gif so that people can see your sample in action (as long as you promise to pronounce it "gif", not "jif")

Adding a README.md

Each sample must have a README.md which will help people understand how cool your sample is and how to use it.

Copy the README.md template from https:/pnp/powerapps-samples/blob/main/samples/README-template.md and save it in the root of your sample folder as README.md.

Take the time to fill the template to the best of your ability. You spent your time building an awesome sample, you should definitely take a moment more to explain why it is awesome!

Make sure to include the screenshots you created in the README.md file. You should be able to insert screenshots by using the following syntax:

![Describe the image](./assets/yourfilename.png)

Submit as a sample

Well done! Now you can submit these source code files as a sample. Please, use the following steps:

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 💖

Clone this wiki locally