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 / Problem with LoadData ...
Power Apps
Answered

Problem with LoadData App.OnStart vs App.StartScreen

(0) ShareShare
ReportReport
Posted on by 50

Hi,

I have an app that uses SaveData to stores a Collection to the device if the user saves while being Offline.

 

The problem is, my original formula with the App.OnStart works fine as it always did but I do get the warning that Navigate is not suggested in .OnStart use the StartScreen property instead for better performance.

 

So not doing anything this still works, if I have Offline data it navigates to the StartFromShutDown screen else it navigates to the Start Screen.

App.OnStart
Set(
 CurrentUser,
 User()
);
LoadData(
 QKontrollfrågaResultat,
 "KontrollfrågaResultat_3Save",
 true
);
If(
 CountRows(
 Filter(
 QKontrollfrågaResultat,
 ConnectedSave = "Nej"
 )
 ) <> 0,
 Navigate(
 StartFromShutDown,
 ScreenTransition.Cover
 ), Navigate(Start))

 

But if I change it to this, according to this post https://powerapps.microsoft.com/en-us/blog/app-startscreen-a-new-declarative-alternative-to-navigate-in-app-onstart/

 

The result is I always get the Start screen, even if I have Offline Data stored it never goes to the StartFromShutDownScreen

(The Actual Start screen is named Start)

 

App.OnStart
Set(
 CurrentUser,
 User()
);
LoadData(
 QKontrollfrågaResultat,
 "KontrollfrågaResultat_3Save",
 true
)
-------------------------------------------------------------------
App.StartScreen
If(
 CountRows(
 Filter(
 QKontrollfrågaResultat,
 ConnectedSave = "Nej"
 )
 ) <> 0,
 StartFromShutDown, Start)

 

Any idea why this isnt working?

Categories:
  • WarrenBelz Profile Picture
    156,576 Most Valuable Professional on at

    HI @drwaz ,

    Your logic looks sound and it is a pity you cannot use Global Variables on StartScreen - one thing you could do to debug is put this at AppOnStart and see the number returned 

    Set(
     CurrentUser,
     User()
    );
    LoadData(
     QKontrollfrågaResultat,
     "KontrollfrågaResultat_3Save",
     true
    );
    Set(
     myRows,
     CountRows(
     Filter(
     QKontrollfrågaResultat,
     ConnectedSave = "Nej"
     )
     )
    );
    Notify(
     "Your have " & myRows & " rows"
    )

    You could also try

    If(
     CountRows(
     Filter(
     QKontrollfrågaResultat,
     ConnectedSave = "Nej"
     )
     ) > 0,
     StartFromShutDown, 
     Start
    )
    

    but I don't think it will make a difference.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • drwaz Profile Picture
    50 on at

    Thanks for the Quick reply,

    I tested what U suggested and I do indeed get a notification that I have rows that are stored in the Offline data thats being loaded, it does not however navigate to the StartFromShutDownScreen. I tried toggling the Enable Navigate Function in App.OnStart on and Off and still the same result.

     

    I can without any issue force the the app to go to the StartFromShutDown screen with an If statement such as

    If(1+1 = 2,
     StartFromShutDown, 
     Start
    )

     

    So might there be an issue with either the use of CountRows or Filter in the App.OnStart?

  • WarrenBelz Profile Picture
    156,576 Most Valuable Professional on at

    Hi @drwaz ,

    I have a bad suspicion on what is happening here - this is only a new function and I have it working based on incoming deep linked parameters, which of course exist in the URL starting the app (and I know Global Variables cannot be used on StartScreen), however what if the StartScreen is executing BEFORE the OnStart finishes . . . Please have a read of this document, in particular these comments

     

    This poses a performance problem.  If App.OnStart contains a Navigate function call, even if it is in an If function and rarely called, we must complete execution of the App.OnStart before we show the first screen of the app.  Ideally we would show the first screen as soon as its dependencies are satisfied, but defer work that are only required by other screens of the app.

    and also

    App.StartScreen is separated out from App.OnStart in the second case.  They are independent and can be evaluated separately.  We can show the first screen before App.OnStart is complete.  This is huge.  Today, if the App.OnStart contains a Navigate call, we can’t show the first screen until the entire App.OnStart has completed, blocking optimizations that would improve app load time.

     

    If this is the case, I am not sure how you will base your start screen on something that needs to happen on OnStart.

     

  • drwaz Profile Picture
    50 on at

    I didnt read those comments first when looking into this but yeah this sounds about right.

    So basing my StartScreen based on whats in/or not in my Offline Collection would not really work then.

     

    So I guess a workaround here would be to throw in a button on the start screen and base its visible property on the CountRows(Filter) instead

  • Verified answer
    WarrenBelz Profile Picture
    156,576 Most Valuable Professional on at

    Hi @drwaz ,

    Another thought would be to have a landing screen with an Enter button (and company logo etc) and put the navigation logic on the button

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • drwaz Profile Picture
    50 on at

    Yeah, true.

    Thanks for giving me some ideas!

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard