cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
WorkHard
Super User
Super User

Strange issue with LookUp method not loading the item OnVisible everytime

I have an app connected to a SharePoint List.

Under some circumstances, I need to LookUp a record right when I load the EditScreen. This works sporadically and about every 5th refresh the app loads before the LookUp completes.

 

Would this be considered a bug? How can I ensure the app waits for the LookUp other than an arbitrary timer?

 

 

 

Set(DeepLinkThisItem,LookUp(MySharePointList,ID = 28)));
//I even hardcoded a specific ID to make sure it's not my variable I use that stays blank at launch.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
WorkHard
Super User
Super User

Moving the function to OnStart of the App instead of the OnVisible of the screen appears to fix the issue.

View solution in original post

2 REPLIES 2
WorkHard
Super User
Super User

Moving the function to OnStart of the App instead of the OnVisible of the screen appears to fix the issue.

Drrickryp
Super User
Super User

@WorkHard 

I think you are getting inconsistent results because your command may not be executing as fast in some cases, If you are Navigating to the edit screen from another screen, you can put your command before it.  

 

Set(
     DeepLinkThisItem,LookUp(
                             MySharePointList,ID = 28
                       )
);
Navigate(youreditscreen)

This should ensure that your variable is created before the edit screen is instantiated. 

 

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

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

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,190)