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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Getting screen size wi...
Power Apps
Answered

Getting screen size without specifying the screen

(0) ShareShare
ReportReport
Posted on by 46
Hi guys, this could be one of those things that's very simple and is just functionality I've not seen so sorry if this is a stupid question:
 
I'm building apps with a lot of custom dynamic sizing where I am currently using switches and if statements off the back of the screen's size.  Example:
 
Switch(Page1.Size,
    1,Parent.Width-15,
    Parent.Width/4-Self.LayoutGap/2*3-3
)
The problem with this is that I have a large number of screens requiring me to change the screen name within this function each time.  Additionally, I'm now starting to need to include these functions within components that are shared across multiple screens.  In the example for 'Page1' above, if the same component is used in 'Page2', I now need to create a duplicate component with a 'Page2' equivalent function.
 
What would be ideal would be if PowerApps had some sort of App level screen size element or the ability to having something like ThisPage.Size but I'm unaware of anything that exists.
 
Can anyone suggest anything that does exist or a workaround anyone can think of?
 
Thanks,
Dan
Categories:
I have the same question (0)
  • Vejai SH Profile Picture
    555 on at
  • Verified answer
    Pstork1 Profile Picture
    68,725 Most Valuable Professional on at
    There is also an App.Width and App.Height property that will give you the size of the device screen.  If you build the app to be responsive by turning of Scale to Fit in Settings then the App.Width and App.Height will give you the height and width of the screen.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • dbarnesab Profile Picture
    46 on at
    Thank you @Pstork1, that's perfect!  I did say it's probably basic functionality that I've missed! 
     
    I can now do something like this:
    If(App.Width>1200,Parent.Width/4-Self.LayoutGap/2*3-3,
        If(App.Width>800,Parent.Width/4-Self.LayoutGap/2*3-3,
            Parent.Width-15
        )
    )
    Combining the built in screen sizing (1,2,3 & 4) with the pixel output of this may be tricky but manual values of 1200, 800 etc. as above will work fine.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard