Subscribe

Host Object in Power Apps

3rd May 2023

In today’s blog post, we’ll take a look at a new feature from Microsoft recently pushed out to the canvas apps studio allowing us to get more contextual information about our app session. This opens up some pretty cool new possibilities with what we can do to customise the user experience we deliver to users through our applications. Let’s take a look!

Tenant Id

One of the four properties we can get to with the host object is the current tenant id we’re working in.

To make use of the tenant Id we’re currently working in from an app, we can use the following formula to reference this property out of the host object.

Host.TenantID

Session Id

The next property I’ll talk about is the session Id property. This is super useful for debugging and scenarios where you need to provide a session Id to Microsoft for support tickets and those conversations where they can look at telemetry and reporting to diagnose issues.

You’ll probably be thinking that this isn’t a great thing to have displayed to users all the time though just for a case when we might need a session id.

Idea… you could have the visibility of a label that shows the session Id determined by whether a url parameter is passed in or not. You can refer to this post for more understanding on these parameters.

To reference the session Id you’ll want to use the following formula.

Host.SessionID

BrowserUserAgent

Using the browser user agent property we’re able to identify the browser a user is running their app in. To use this property you can use the following formula.

Host.BrowserUserAgent

OSType

The final property we can use to get some data from is the OSType property. Using this we’re able to find out the current OS users are working on, and that the app is running in.

To get hold of the current OS being worked on behind an app, we can use the following formula.

Host.OSType
Posted in Uncategorized

Leave a Reply

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

This will close in 0 seconds