web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Inconsistent SharePoin...
Power Apps
Unanswered

Inconsistent SharePoint LookUp Results Depending on Timing

(0) ShareShare
ReportReport
Posted on by 22

I would really appreciate any help figuring out what is causing this strange behavior and how to prevent it in the future.

I have an app that allows users to select multiple fields across a couple of different screens before eventually submitting the results. One of the fields corresponds to a Department within the company, and when the specific department is selected there is a LookUp() that occurs on a dev screen (users do not have access to this screen) based on a SharePoint list that has been connected to the app that contains the department names and their associated ID numbers.

Strangely, this lookup appears to have inconsistent behavior. Sometimes the lookup is able to resolve the correct department ID number based on the department, while other times it seems to be returning a null value that causes issues when being submitted to the null department.

To be clear, a null result should not be possible. The list of department selections is based off a list of departments that the department ID list was generated from, so every department selected will have an associated ID number. In addition, I have tested every department submission myself and are able to submit without issue.

When I have been able to recreate the issue, it is from having another user login to use the app and proceed quickly though the various screens to submit a result. These users will receive an error that "We cannot convert the value to a number because the value is not a string." which is an error that I have never received throughout all of my testing.

Tracing this error leads to the fact that the lookup appears to return {0} because the Value() function I run on the return of the lookup yields the following error:
"The value '{0}' cannot be converted to a number." This once again should not be possible, because {0} or 0 are not department ID's and the department name being looked up is a valid name that is able to resolve to an ID when I submit the same department.

What I have noticed is that timing appears to be a major factor in recreating this issue. If the user waits on the screen after the department is selected for long enough (I have sometimes seen a loading bar appear at the top of the screen) the issue does not appear to occur. Once it has been loaded, the issue does not seem to occur again. However if the user does not have the current version of the app cached and rushes through the selection screens without waiting the lookup fails to resolve and causes the error.

 

I am guessing the fact the most recent version of the app is cached on my machine is the reason I did not experience this issue during any of my submissions.

Despite trying my best I can't seem to find any other users who have experienced a similar issue with loading information from a SharePoint data source.

 

Is this normal behavior? Am I correct in assuming that the issue has to do with loading the information from the SharePoint list quickly enough? Is there anyway for me to preload the information so that I can guarantee the ID will resolve into a number? Would moving the ID lookup off the Dev screen help with this issue?

I would appreciate any insight into this unusual problem.

 

Categories:
  • Scott_Parker Profile Picture
    1,090 on at

    @alltheabove wrote:

    One of the fields corresponds to a Department within the company, and when the specific department is selected there is a LookUp() that occurs on a dev screen (users do not have access to this screen)

     


    This is the problem. Controls on the current screen are prioritized when loading to improve the user experience. Perhaps Power Apps will load controls in the background for other screens as it sees fit, but you can't count on it. You're never going to be able to be 100% confident how, if, or when offscreen controls will load.

     

    You will see inconsistent behavior if you're counting on an offscreen control to handle your data for you. It will be especially noticeable between the published app and when you are editing the app. The only answer is to not do so.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard