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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,242)