Host Object in Power Apps

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… READ MORE [https://lewisdoes.dev/blog/host-ob
black and silver film camera on brown wooden surface
Photo by Tirachard Kumtanom on Pexels.com
In: Low Code Lewis Content 🚀

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
Written by
Lewis Baybutt
Microsoft Business Applications MVP • Power Platform Consultant • Blogger • Community Contributor • #CommunityRocks • #SharingIsCaring
Comments
Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to LewisDoesDev.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.