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

View solution in original post

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

 

Thanks,

Gene

 

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,397)