Loading...

How to show the app version in Power Apps Canvas Apps

How to show the app version in Power Apps Canvas Apps

tl;dr

You can display the current app version in a canvas app using the Power Apps for Makers connector. This is especially helpful while during developing/debugging Power Apps for Microsoft Teams.

⚡ When building a Canvas app for Microsoft Teams, you will add your app to Teams to get contextual information such as locale or theme of Teams and validate if your app works as intended. In Power Apps Studio, there is a nifty button for that, which abstracts away the creation of a manifest.json file, but has some flaws. (Stay tuned for a post that covers that)

add an app to Teams

One of the problems is, that once you added the app to Teams, it doesn’t always pick up the latest version - which can make debugging a nightmare, as the UI in Teams doesn’t show you what you see in Power Apps Studio or in your extracted files in Visual Studio Code. Gave me some want to bang my head against the keyboard moments until I figured that the changes I made were just not present in the version that Teams picked up 🤯

Power Apps for Maker connector

Power Apps for makers

Microsoft built a connector called Power Apps for Makers, which can help with that issue. The connector can show all kinds of information about the apps that you build and we can use it to display the version number inside of the canvas app. I usually have a variable in my apps called isDebugMode that controls if I want to display information for myself during development/debugging.

We will use three functions of that connector:

  1. PowerAppsforMakers.GetApps, which gives us the names of our apps (watch out, these are not a friendly name/displayName, but a GUID)
  2. PowerAppsforMakers.GetAppVersions, in which we can pass in the app name to retrieve the version number.
  3. PowerAppsforMakers.GetApp which gives us the creation timestamp

Get the app name

To get the app name, add a text label, set its Text property to

LookUp(
PowerAppsforMakers.GetApps().value,
properties.displayName = "PrettyUp",
name
)

We use LookUp to get the name property of an app that has a displayName PrettyUp. This will return the GUID that we need to pass into the PowerAppsforMakers.GetAppVersions function in the next step.

Get timestamp

We can get the timestamp when we last published the app with

PowerAppsforMakers.GetApp(
LookUp(
PowerAppsforMakers.GetApps().value,
properties.displayName = "PrettyUp",
name
)
).properties.appVersion

Once again we pass in the GUID dynamically with the LookUp function.

💡 Watch out, properties.appVersion is not the version number, but a date-time field/timestamp.

Get the app version

As we want to get the version every time we run OnStart, its a good idea to put these functions in the OnStart property of your app:

Set(
appVersion,
CountRows(
PowerAppsforMakers.GetAppVersions(
LookUp(
PowerAppsforMakers.GetApps().value,
properties.displayName = "PrettyUp",
name
)
).value
)
);
Set(
appTimeStamp,
PowerAppsforMakers.GetApp(
LookUp(
PowerAppsforMakers.GetApps().value,
properties.displayName = "PrettyUp",
name
)
).properties.appVersion
)

In the first function, as we don’t want all versions, but only the latest one, we will use CountRows() and return the value of the PowerAppsForMakers.GetAppVersions table, in which we use the LookUp function of step 1. In the second function we will use PowerAppsForMakers.GetApp to retrieve the appVersion.

Show app version on screen

Change the Text property of the text label of step 1 to "This is v." &appVersion & " published last time " & appTimeStamp.

app version

If you now publish your app and add it to Teams, you can see which version you are on and when you lastly published. This way it’s easy to determine if Teams picked up the latest version of your canvas app.

Feedback and what’s next

I’m curios as always - how do you use the Power Apps for maker connector and which struggles do you have with debugging Power Apps for Teams? Let me know on twitter! If you found this blog post useful, please also subscribe to my newsletter - news coming about every 2 months, I promise to not spam you!

Published on:

Learn more
Luise Freese: Consultant & MVP
Luise Freese: Consultant & MVP

Recent content on Luise Freese: Consultant & MVP

Share post:

Related posts

Microsoft Power App Environments Retention Period

If you are wondering how long different environment types within the Microsoft Power Platform retain your backup data, this article is for you...

2 days ago

Increment and Decrement in Power Apps Dataverse Workflow | Tutorial

This is a video tutorial about incrementing and decrementing values in Workflow Power Apps Dataverse. With the help of this tutorial, you will...

4 days ago

Power Apps April 2024 Feature Update: What's New for Makers, Admins and Users | Power Apps Blog

If you're a Power Apps user, you'll be glad to know that the platform has some exciting new features in store for you. In this monthly feature...

4 days ago

Customer Managed Encryption Keys for Power Apps Now Available!

Microsoft has announced the General Availability of Customer Managed encryption keys (CMK) for Power Apps data in your environments. This upda...

5 days ago

Building Power Apps Business Process Flows & Documentation

Get ready to dive into the world of Power Apps with this informative tutorial that covers building a business process flow for your model-driv...

6 days ago

How to Create Multi-Step Forms in Power Apps | Step-by-Step Tutorial

If you're looking to streamline your form creation process, this tutorial on creating multi-step forms in Power Apps is the perfect starting p...

7 days ago

How to Add AI Prompts to Your Power Apps | Step-by-Step Guide

In this video tutorial, you'll learn how to incorporate custom AI prompts into your Power Apps canvas app using Power Virtual Agents. The tuto...

7 days ago

Beginner's Guide to Model Driven Power Apps | Full Course 2024

If you're looking to dive into the world of Model Driven Power Apps, this beginner tutorial is the perfect place to start. In this full course...

7 days ago

Achieve Complex Multi-Combo Box Filters on Collections | Canvas App

This article delves into the world of complex multi-combo box filters for collections within Canvas Apps. The article uses a real-world scenar...

7 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy