cancel
Showing results for 
Search instead for 
Did you mean: 

Execute OnStart() on Preview

I've noticed that during development, the only time that the code on my first screen's OnStart() property is executed is when I open the app for editing or viewing. It's inconvenient to have to re-open the app just to test my OnStart() code.

 

Please make OnStart() work on Previews or create a new kind of Preview that starts the app as it were used by some end-user.

 

Also, is it just me or the OnVisible property of the first screen doesn't get executed as I open the app? EDIT. It only doesn't on previews. I'm sorry. 

Status: Completed

This idea has been completed through allowing you to Run the OnStart property within your app form the tree view.

See the blog here: https://powerapps.microsoft.com/en-us/blog/tree-view-has-an-app-item-to-make-app-building-easier/

Comments
Level: Powered On

I can't agree more!  I've taken to hiding a button (from everyone but me) on the form and keeping its "OnSelect" code identical to the screen's "OnStart" code.  It's not a pretty workaround, but until this gets "fixed," it beats logging off and on.

Microsoft Employee

I'd like for this to work like Visual Studio.  Pressing Play does what it always does.  But pressing SHIFT-PLAY does a complete restart of the application, clearing out all variables and collections and executes the OnStart.

PowerApps Staff
Status changed to: Completed

This idea has been completed through allowing you to Run the OnStart property within your app form the tree view.

See the blog here: https://powerapps.microsoft.com/en-us/blog/tree-view-has-an-app-item-to-make-app-building-easier/