cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
geneZebra
Resolver II
Resolver II

Noticed race condition with app.onstart and screen.onvisible - work around available

I noticed that the first screen's OnVisible function may be called before app.OnStart is done. I have an app that sets some variables by calling office365users search functions that sometimes take a some time to execute (almost every time on a non studio launch). My first screen of the app uses onvisible to calculate a collection that is used to render the values on the screen. I noticed that almost every launch outside of studio does not show all the controls properly but if I simply navigate off and back to the screen (or used a button to refresh the collection used by all the controls that are not rendering properly, all is shown correctly. 

To work around this issue, I simply put in a navigate call in my app.onStart functon. This seems to ensure the screen is shown only after the dependent variables are calaculated.  Powerapps should ensure this order or at least document that it does not wait for app.start to complete before rendering the first screen.

 

hope this helps.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

There is also a new boolean which does the same.

so it will first do the on start and then the first screen2019-07-23 14_37_34-[DEV] Inkoopfactuur controle - PowerApps.png

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

There is also a new boolean which does the same.

so it will first do the on start and then the first screen2019-07-23 14_37_34-[DEV] Inkoopfactuur controle - PowerApps.png

I didn't think to look there. I wish the docs mentioned it  🙂

 

Thanks,

Gene

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,373)