cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tapesh
Post Prodigy
Post Prodigy

Responsive form based on screen size

Hi All, 

I wanted to make a form responsive such that width of the form changes according to the size of the screen however i tried some of the things on the width formula of form but seems like it does not work for me 

 

If(ScreenSize >= 850, Max(App.Width)/2, Max(App.Width)/1)

 

If(Parent.Width = 640 || 750 ||850 , Max(App.Width)/1, Max(App.Width)/2)


the result is no change is form width in real time , 

 

can anyone help what m i missing here. 

Thanks 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

Where are you putting that formula?  First, you can't adjust the Parent properties from inside another control.  Nor can you set the value of a property from a formula.  The If statement should be in the width and height properties of the parent control itself. so something like this in the Width of the parent control

Switch(Screen1.Size,
        ScreenSize.Small, 640,
        ScreenSize.Medium, 1000,
        ScreenSize.Large, 1200,
        1600)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User III
Dual Super User III

Take a look at the following article on Responsive Design in Power Apps.  It has all the information you need.  There are some settings that you need to disable in order to change the size of the form to match the Height and Width of the screen.  Please Note: this only works in a Browser if you set the browser to Full Screen.  Otherwise even with Responsive Design in place it will fit the screen into the visible window in the Browser and then scale the width.  But it will work in both the mobile and desktop clients.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-responsive-layout



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi @Pstork1 

 

Thanks for the solution, but i actually have looked into this document earlier and also was following the same thing, but the major issue is with screen size, while i put 

(if (ScreenSize = Small || 1, Parent.Width = 640, Parent.Width = 1200)) the formula seems to be correct but there are no results on the screen when i publish and check using web link which i guess i opens up in browser. 


Is there anything else you can help with ?

Thanks for the reply.

Pstork1
Dual Super User III
Dual Super User III

Where are you putting that formula?  First, you can't adjust the Parent properties from inside another control.  Nor can you set the value of a property from a formula.  The If statement should be in the width and height properties of the parent control itself. so something like this in the Width of the parent control

Switch(Screen1.Size,
        ScreenSize.Small, 640,
        ScreenSize.Medium, 1000,
        ScreenSize.Large, 1200,
        1600)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,088)