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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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