One of the annoying features of Canvas Power Apps is that only one user can open the app in edit mode. I don’t often want to edit an app at the same time as another maker. However, quite often I would like to check some detail about a solution when it is being edited by someone else.
Another annoying feature is that the entire contents of a Power App can not be accessed anywhere in plain code. This would speed up for example, renaming variables, changing the font throughout the application, or figuring out where variables are being used.
Of course, for almost a year now, we have been able to unpack Canvas Power Apps as code and take them to version control. But it has been more or less manual work. Not many makers have actively used this feature.
But now this is all changing. Canvas Power Apps can be connected to version control (almost) at the touch of a button. All changes are automatically saved there too with each save. And the same app can be edited by multiple makers at once!
Amazing. Let’s see how this works.
Version Control – Git (GitHub)
I have created a new repository for the application (MySecondPowerAppsInGitHub).
The connection between version control and Power Apps is established using a personal access token. Not with a Git username and password.
Create a new token in the Personal access tokens section under Settings > Developer settings.
Now we have a place for our application on GitHub.
Connecting to Git
Let’s create a new Power App and go to its settings. Git version control can be found in the experimental features.
When we turn on the feature, a new section will appear in the menu: Git version control.
Let’s use the Connect button to establish a connection to version control, and then enter the following information
- Git Repository URL : The address of the repository
- Branch : The name of the branch to use
- Directory : The directory to use
The repository provided must exist. The branch and directory are created if they are not found.
Finally, let’s log in. Note! The personal access token created in Git is used as the password.
Power Apps does not store your Git password. You should save the token in a password manager (or in your browser’s memory). Otherwise, you will be creating a new token every time you open Power Apps for editing…
Now the connection is established.
At the same time, the missing main branch and MyApp directory were created in Git.
Making changes (Power Apps)
Let’s add a few controls to the app.
And also save and add a comment (Version notes).
Saved changes will be visible in Git immediately. Likewise the comment added during the save.
And I didn’t make any Git commands from the command line. I don’t even have to know what they are.
Changes made by others
When saving, Power Apps studio checks to see if anyone else has edited the app. The changes will appear automatically.
In the image below you can see a new label “Added by BigBoss” that was added by another user.
We can also commit the changes with the sync button at the top right.
Now the changes I made have been confirmed.
Based on brief testing and reading of the documentation, it’s a little unclear what the difference between saving and syncing ultimately is. Both end up committing the changes.
"Each save or synchronize that includes changes will result in a commit in Git."
Also, after both actions, changes made by others will appear in the editor.
Simultaneous editing of Power Apps works surprisingly well. Even the same control can be edited at the same time. However, if users edit the same property (e.g., height) of the same control, the last edit remains in effect.
It is not possible to resolve possible conflicts between changes by yourself. Power Apps studio does it for you, and it may not always work. If the outcome is not satisfactory, things can be corrected from Git. Any changes made to the App will be saved there.
Editing in version control
In GitHub, let’s go to the screen 1 code, and rename the controls btnButton and inpSearch. Finally, let’s commit with the appropriate comment.
After this, let’s sync the Power Apps. Yes, the names of the controls have been changed!
The Git integration of Canvas Power Apps is only an experimental feature. I do not recommend using it yet in production applications. However, it still works surprisingly well.
As a feature, this is exactly what I have been longing for. An easy way to get apps to GitHub, making it easier to make certain types of changes and troubleshoot problems.
As an additional bonus, we also get the simultaneous editing of applications.
Next on my wish list is an equally simple implementation for publishing an application from Git to a desired Power Platform environment. Then I would be happy. For a moment.
Interested in reading our latest Power Platform blog posts?
You’re welcome to subscribe to our email newsletter: Forward Forever Monthly. Max 1 email per month, with a curated list of latest insights and articles on Power Apps, Power Automate, Power BI.