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 / Unexpected results wit...
Power Apps
Unanswered

Unexpected results with formula-level prefetching

(0) ShareShare
ReportReport
Posted on by 1

I have encountered issues with formula-level prefetching on Canvas apps in several different areas:

 

  1. Apps that need to submit to SharePoint, fetch new data, load that data to a local collection, and then use the local collection to store data in a variable - It appears that when formula-level prefetching is turned on the app attempts to increase performance by storing data in the variable first before submitting data to SharePoint and updating the local collection. For example, the following code submits a form to SharePoint and then uses the last item submitted to SharePoint in a local variable. However, when formula-level prefetching is on it will set the variable to the last item in the local collection prior to submitting to SharePoint:
    • SubmitForm(Form1);
      Refresh(SharePointList1);
      ClearCollect(
      LocalCollection,
      Filter(
      SharePointList1,
      'Created By'.Email = User().Email
      )
      ));
      Set(LocalVariable, Last(LocalCollection).Column);
  2. Apps that use If(Connection.Connected) to initialize local collections from SharePoint if online or load local collections from device if offline - For example, the following code initializes a local collection OnStart of the app either by pulling the data from SharePoint (if online) or by loading data from the users device (if offline). When formula-level prefetching is turned on if the user is offline they will get an error (issue with connecting to datasource). It appears as though the app is trying to preload the local collection with data from SharePoint before ever reading the conditional logic:
    • If(Connection.Connected,
      ClearCollect(
      LocalCollection,
      SharePointList1
      )
      ,
      LoadData(
      LocalCollection,
      "OfflineLocalCollection",
      true
      )
      )

In both of these cases turning off formula-level prefetching solved the issues and the app ran as expected.

 

Is there a way to override when formula-level prefetching is performed so that we can guarantee that code is run sequentially when the user knows that order is critical for the apps function? 

Categories:

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 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard