Canvas Apps offer enormous flexibility — and that's exactly why they become the biggest messes. Here are 6 things I do in every application.
1. Name screens and controls meaningfully
Calling a button Button1 is a recipe for disaster. I use a prefix convention:
scr— Screen (scrDashboard,scrDetail)btn— Button (btnSave,btnBack)gal— Gallery (galProjects)lbl— Label,ico— Icon,txt— TextInput
Once you get used to it, you can't write it any other way.
2. Global variables only for global things
A classic mistake: Set(varName, ...) at every step. Global variables (Set) are for state across the entire app. Context variables (UpdateContext) are for single-screen state. Mixing them causes inexplicable behavior.
3. Load data collections in OnStart or OnVisible
Don't load data inside a form or gallery. Use ClearCollect(colCustomers, ...) in App.OnStart or the relevant screen's OnVisible. The app will be snappier and the code cleaner.
4. Use Named Formulas (Preview)
Newer versions of Power Apps support Named Formulas — named calculations that update automatically. Instead of repeating the same expression in 10 places, define it once:
ActiveProjects = Filter(colProjects, Status = "Active")
5. Use With() for local calculations
Instead of storing an intermediate result in a variable just to use it in one place, reach for the With() function:
With(
{ total: Sum(galItems.Items, Price * Quantity) },
If(total > 10000, "Large order", "Standard")
)
No variable, no side effect — the calculation lives only where you need it.
6. Test on mobile throughout, not just at the end
A Canvas App looks great on desktop and falls apart on mobile. Switch layouts regularly — it will save your last day before handoff.
Power Fx is a functional language — it rewards a clean, declarative approach. The fewer side effects, the better.