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 / Screen Datasource Pre-...
Power Apps
Unanswered

Screen Datasource Pre-Loading Behaviour

(1) ShareShare
ReportReport
Posted on by 2,914

Would be interested to know if there is any information available on the conditions when a PowerApp attempts to retrieve data from a data source. Based on my scenario below, it appears that the datasources within a screen are triggered (start trying to retrieve data) when a button is selected that contains a command to navigate to that screen, even though the navigate is inside an If statement and so the navigation may not occur.

Scenario

My App has offline and online mode. There are some screens where galleries display data either from the offline (local collection) datasource or the online datasource (in this case Dynamics 365 CE) depending upon connection state.

Initially I had an If statement within the Gallery Items property:

If(Connection.Connected Or Connection.Metered, 
Filter(Accounts, Account = .., 
Filter(colAccounts, Account = ...)

However, the App was attempting to read data from the Dynamics Account entity even when the App was in offline mode (resulting in an error).

I therefore created two separate screens, one for offline and one for online. I then put an If statement on the button that calls the screens:

If(Connection.Connected Or Connection.Metered,
Navigate('Select Account',Cover,{conSelectedAccount:conSelectedAccount}),
Navigate('Select Account Online',Cover,{conSelectedAccount:conSelectedAccount}))

Even with this, when the button was pushed in offline mode, the App was still attempting to read data from the Dynamics Account entity (resulting in an error).

Finally I put two buttons on the screen - one to navigate to the screen with the gallery based on the offline data and one to navigate to the screen with the online data. I then set these buttons to be visible depending on the connection state and finally I can prevent the App from trying to retrieve data from the online source while the App is offline.

Some info on exactly what circumstances result in an App attempting to read data would be appreciated.

Categories:
I have the same question (0)
  • seadude Profile Picture
    1,855 on at

    Hm... Interesting.

    Gut feeling is that its one of the settings in AppSettings/Advanced Settings.

     

    • Have you set any of these from Default?
    • If not, should you?

    I can't answer the 2nd one, but IIRC there are a few in there that "Optimize" things. One of these optimizations may be to see what data sources your app has and Pre-fetch them... just a guess.

     

    Very interested to see what you find.

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    HI @PaulD1 ,

    Thanks for sharing your idea. That's an interesting phenomenon.

    For now, I haven't found any doc about this.

    If I find anything about it, I will reply here.

     

    Best regards,

    Community Support Team _ Phoebe Liu

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard