Skip to main content
Post

#PowerPlatformTip 69: 'Optimize Loading with Fullscreen Reference'

#PowerPlatformTip 69: 'Optimize Loading with Fullscreen Reference'

TL;DR: For fullscreen root containers, size them from the source value instead of the screen: Width = Max(App.Width, App.MinScreenWidth) and Height = Max(App.Height, App.MinScreenHeight). That is the same value the screen uses, taken directly from the app window. A formula based on App only depends on the window and can be calculated right away, a Parent-based one waits for its parent, level by level.

Like in Excel, a formula that references another control creates a dependency, and Power Apps calculates it from that source (Microsoft Learn: formulas and dependencies). With Parent.Width, every level needs the calculated size of the level above: window, screen, container, nested container, control. That nested chain is resolved one after the other. With App.Width, a control depends on the app window only. All controls with this flat dependency can be calculated at the same time, so the layout is ready sooner when the app loads.

💡 Challenge

Fullscreen layouts are usually built with Parent.Width and Parent.Height on the top-level container. Parent is the screen, and the screen’s own Width and Height are formulas based on the app window. Every root container therefore waits for the screen’s formula, and every nested control waits for its container.

✅ Solution

Reference the app window directly in your root containers. The App.Width and App.Height properties correspond to the dimensions of the device or browser window in which the app runs. The screen’s default formulas are:

Width  = Max(App.Width, App.MinScreenWidth)
Height = Max(App.Height, App.MinScreenHeight)

Use the same formulas on your root containers and they get the screen’s size straight from the source.

🔧 How It’s Done

1. Set the root container to the window size.

🔸 Select the top-level container of the screen and set:

Width  = Max(App.Width, App.MinScreenWidth)
Height = Max(App.Height, App.MinScreenHeight)

🔸 Keep the Max(..., App.MinScreen...) part. A plain App.Width gets smaller than the screen when the window is narrower than the minimum screen width, and the layout no longer fills the screen.

2. Keep Parent inside the containers.

🔸 Child controls that size relative to their container continue to use Parent.Width and Parent.Height. Their Parent is now the container anchored to the window, so the chain starts one level lower.

🔸 Fullscreen elements deeper in the tree, for example a full-width header bar, can use the same App-based formula. Then they do not wait for their container either.

3. Set the minimum screen size once.

🔸 Define MinScreenWidth and MinScreenHeight on the App object (Properties > Advanced). Below these values the screen scrolls instead of shrinking the layout.

4. Check responsiveness.

🔸 In Settings > Display, set App layout to Responsive (older Studio versions: turn off Scale to fit), so App.Width and App.Height follow the real window. With a fixed layout they return the design size.

🔸 Play the app and resize the browser window, or rotate a tablet. The screen formulas are reevaluated when the window size changes, and the containers follow immediately.

🎉 Result

The root containers get their size directly from the app window, at the same time instead of one after the other. The layout stays identical to a Parent-based one and adapts to every window size and orientation.

🌟 Key Advantages

🔸 Faster loading: a flat dependency on the app window instead of a nested chain, so the sizes are calculated at the same time instead of one after the other.

🔸 Same layout: Max(App.Width, App.MinScreenWidth) is exactly what the screen uses.

🔸 Responsive by default: resizes and rotation are picked up automatically.

🛠️ FAQ

1. Why not simply use App.Width and App.Height?

Because the screen never gets smaller than MinScreenWidth and MinScreenHeight, but App.Width and App.Height do. Wrap them in Max() with the minimums to get the same size as the screen.

2. Will this change affect my existing app layouts?

Not if you use the Max() formulas above: the container gets the same size as before. Nested controls keep their Parent references.

3. Why doesn’t my layout react to resizing the browser window?

The app layout is still Fixed (Scale to fit on). With it, the app scales one fixed design canvas instead of reflowing. Set App layout to Responsive in Settings > Display to build a responsive layout.

🔸 #PowerPlatformTip 32: ‘Optimize with GroupBy’ - a startup-time topic: load data once instead of per dependent filter.

🔸 #PowerPlatformTip 78: ‘Efficient Control Reset’ - another small formula change in the same spirit.

This tip is by Marcel Lehmann, Microsoft MVP (Business Applications) and founder of the Power Platform Academy, which runs free live workshops (in German). See the next free workshop dates (in German). For companies that want this implemented for them, see KMUpower: Power Platform consulting & automation for SMEs (DACH).

This post is licensed under CC BY 4.0 by the author.

Microsoft and the Power Platform product names (for example Power Apps, Power Automate, Copilot Studio) are trademarks of the Microsoft group of companies. This is an independent website. It is not operated, sponsored or endorsed by Microsoft.