Skip to main content

What the Enable App.OnStart Property Setting Does in Power Apps

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

Power Apps Studio has a setting called Enable App.OnStart property, with a warning that OnStart "can cause delays when loading an app". It's tempting to switch it off to keep an app fast. This guide tested what the switch actually changes, and the result is a little surprising: in Studio, an OnStart formula still ran with the switch off.

Why OnStart Has a Switch at All​

App.OnStart runs a formula when the app starts. Microsoft now recommends alternatives because OnStart can slow loading:

Microsoft's App object reference also says that "depending on your context, the OnStart property might be disabled by default", and that if you don't see it, you can check the app's settings for a switch to enable it. This is that switch.

Prerequisites​

  • A canvas app open in Power Apps Studio. The example is the Career Development Plan app from the Career Development Plan series. Its OnStart is empty.

Step 1: Find the Switch​

Open Settings → General. Near the bottom is Enable App.OnStart property, with Microsoft's description:

Use of the App.OnStart property can cause delays when loading an app and must be used with caution. New alternatives such as App.StartScreen offer a better way to accomplish the same thing.

In the example app it was On:

The General settings page with Debug published app Off, Automatically create environment variables when adding data sources Off, and Enable App.OnStart property outlined in red with its switch On

Step 2: Turn It Off​

Select the switch. Studio asks you to save and reload:

The Save and refresh dialog saying A full page refresh is needed to apply the changes. Save your app before refreshing, with OK outlined in red next to Cancel

Select OK. Studio saves the app, reloads and reopens Settings with the switch Off:

The General settings page after the reload, with Enable App.OnStart property outlined in red and its switch Off

Step 3: What Changed, and What Didn't​

Run OnStart is gone. With the switch on, the App menu in the tree view has Run OnStart, to test the formula without reopening the app. With it off, the menu had only Collapse all, Expand all, Navigate to StartScreen and New comment:

The App menu in the tree view with the switch off, listing Collapse all, Expand all, Navigate to StartScreen and New comment, with no Run OnStart

OnStart itself is still there. It stayed in the App property list, and Studio accepted a formula in it with no error:

The App property list with the switch off, still listing OnStart between OnMessage and SizeBreakpoints

And it still ran. As a test, OnStart was set to this, the app was saved and Studio was reloaded:

App → OnStart (test only)
Set(gblOnStartTest, "OnStart ran")

After the reload, the Variables pane showed the variable set, so the formula had run while the app loaded in Studio:

The Variables pane after the reload, with the global variable gblOnStartTest showing Text "OnStart ran"

So, in this test, the switch didn't stop OnStart from running in Studio. It wasn't tested in a published app, and Microsoft doesn't document exactly what the switch does at run time.

Step 4: Turn It Back On​

The test formula was removed, leaving OnStart empty, and the switch was turned back On through the same Save and refresh:

The General settings page with Enable App.OnStart property outlined in red and its switch On again

Run OnStart came back to the App menu:

The App menu in the tree view listing Collapse all, Expand all, Navigate to StartScreen, Run OnStart and New comment, with Run OnStart outlined in red

What to Do Instead​

Treat the switch as a convenience, not a lock. What keeps an app fast is what's in OnStart:

  • Leave OnStart empty, and use named formulas and StartScreen instead.
  • If you inherit an app whose OnStart is missing, turn the switch on to get it back.

Common Mistakes​

MistakeWhat happensDo this instead
Turning the switch off to stop slow OnStart logicThe logic may still runMove the logic to named formulas or OnVisible
Switching it without saving firstThe reload loses unsaved workSelect OK in Save and refresh, which saves first
Looking for Run OnStart with the switch offIt isn't in the menuTurn the switch on

Troubleshooting​

SymptomLikely causeFix
OnStart isn't in the property listThe switch is off for this appTurn it on in Settings → General
Run OnStart is missingThe switch is offTurn it on
Studio opens read-only after you reload the page yourselfThe earlier session still holds editing controlSee Fixed: "This App Is Read-Only Because You Already Have Editing Control Elsewhere"

FAQ​

Should I turn it off in new apps?​

There's no need. Keep OnStart empty instead; the test above showed that the switch alone doesn't stop a formula in it from running.

Does the switch affect App.Formulas or App.StartScreen?​

Not that the test showed. The example app's named formulas were written, and its StartScreen set, while the switch was off, and both worked.

Is it per app?​

Yes, like every setting under Settings.

Conclusion​

Enable App.OnStart property needs a Save and refresh, and turning it off removes Run OnStart from the App menu. In this test, it didn't stop an OnStart formula from running in Studio. Keep OnStart empty and use named formulas and App.StartScreen; that's what keeps load times down.

Additional Resources​

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.