HeadlinesBriefing favicon HeadlinesBriefing.com

Power Apps OnStart optimization guide

DEV Community •
×

Developers warn that Power Apps' OnStart property often becomes a performance trap. Treating it like a main() function leads to slow load times and brittle code. Microsoft's guidance for large canvas apps recommends moving logic into App.Formulas. This keeps OnStart as a thin orchestration layer, improving maintainability and speed.

The core problem is OnStart becoming a dumping ground. Avoid loading large datasets at startup or running connector calls inside loops. Do not place core business logic here; instead, define user-defined functions and named formulas. Screen-specific setup belongs in Screen.OnVisible. These habits prevent fragile apps and ensure faster first-screen rendering.

To fix this, treat OnStart strictly as a launcher. Keep it deterministic and idempotent, ensuring it doesn't corrupt state on re-runs. Use Concurrent only for truly independent tasks and cache collections selectively. The goal is a fast first screen that only loads what is strictly necessary for the initial view.

Developers should push real logic into the formula bar. Use named formulas for read-only constants and explicit column selection like ShowColumns to reduce payload. Avoid Patch or SubmitForm calls in OnStart to prevent hidden side effects. Documenting each block's intent helps future maintenance and scaling.