web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Difference between get...
Power Apps
Answered

Difference between getFormFactor and getClient

(0) ShareShare
ReportReport
Posted on by 5

Hi,

 

I am trying to determine if my PCF component should render in mobile layout or a web layout. I did not want to use the allocatedWidth and allocatedHeight to determine the layout as this may be a hit or miss and we cannot set a valid threshold to choose a layout (mobile or web) in all scenarios.

 

However, I found the Client.getFormFactor() and Client.getClient() methods and thought that may be the solution. But I can't seem to understand these API in PCF.

 

When creating a Canvas app in a Mobile layout in Power Apps Web client, the getClient() returns "Web" and getFormFactor() returns 1. When will the getClient() return "Mobile" and getFormFactor() return 3 (for Phone)?

 

https://docs.microsoft.com/en-us/power-apps/developer/component-framework/reference/client

 

  • Verified answer
    Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @mapguy2006 , 

     

    The Canvas App "mobile layout" it's just a setup for the size of the screen.

    The client.getClient() tells you where the app is running. As long you call the Canvas App in the webBrowser, you will always get "Web". When the Canvas App is running inside a Mobile App you'll get "Mobile".

     

    So the same App, will have the client.getClient() "Web" when the app is running in the browser, and will be "Mobile" if the app is running in Power Apps Mobile (iPhone, Android App or Power Apps for Windows).

    The "client.getFormFactor" will tell you what device is used.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard