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 / Problems with initiali...
Power Apps
Answered

Problems with initialized variables not being populated OnStart

(0) ShareShare
ReportReport
Posted on by 281

Hi there,
I am having a problem with my variables that I have defined in the OnStart property of the App: Suddenly, they are not populated/shown when I run the published app.

While the first variable shows at least in edit mode, the second doesn't show at all in edit-mode. (After I have hit "Run on start"):

Imke_0-1670415397374.png

But what is totally strange is, that after publishing, even the first variable doesn't show any more:

Imke_1-1670415436349.png

 

I am using a (manual) timestamp to check that I am seeing the currently published version to rule out any caching issues or so.
I am also running the app in the default-modus, so without any parameters. Until half an hour or so, the variables showed up alright and although I (believe) didn't change anything, they started to return empty suddenly.
Has anyone seen such a thing before or has any clue what might have caused it / how to overcome?

Thanks heaps!!

Categories:
I have the same question (0)
  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Do you have 'non-blocking OnStart' turned on for the App? It may be that your other formulae are finishing/running before the OnStart has completed.

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    I would advise doing most of your code on the first screen's OnVisible instead.

  • Imke Profile Picture
    281 on at

    Thanks @iAm_ManCat !
    Yes, that feature is set.
    The entry point for this app can be different screens (using deep links sent via Outlook from Flow) and I don't want to duplicate logic. So App-level seemed the best option for me.

    But I am a beginner, so thankful for any advise.

     

  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    My advice is to have a loading screen - make that your first screen, then on its OnvVsible, perform the functions you are currently using OnStart for - then at the end of that OnVisible you navigate to the screen based on your params as you are currently doing - this way you can always be sure it will complete before you reach the required screen 🙂

  • Imke Profile Picture
    281 on at

    That sounds like a great advise!
    Thanks a lot @iAm_ManCat , will try that out.

  • Imke Profile Picture
    281 on at

    Hi @iAm_ManCat ,
    after adding the last command "Navigate('MyStartScreen') to the "OnVisible"-property of the loading screen, I am getting this error:

    Imke_0-1670614209796.png

    Any idea what I might do wrong here?

     

  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Yes I remember they changed that so you can't do the navigate from OnVisible - make a button, make it invisible

    then on the OnVisible where you had the Navigate('MyStartScreen') instead put Select(ButtonName) and make the OnSelect of the button Navigate('MyStartScreen') 🙂

  • Imke Profile Picture
    281 on at

    Thanks, did as advised but got myself into trouble:
    Now I cannot select/edit the loading screen any more, because there is some auto-play going on here:
    Once I try to select the screen or any of its elements, the automatic forwarding to my start screen is happening here in edit mode as well. I cannot click fast enough to delete the button for example.
    Do you have any idea where I can turn that off, so that I can edit or at least check my code on that page?

  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Yes, I can help with that

     

    To break the formula and prevent it from autonavigating so that you can get back to the page, you can use the search-and-replace and then replace one character in your Navigate('MyStartScreen') - this will break it and allow you to get back to the page

     

    To stop it happening in future, you can create an auto-load variable during OnStart:

    Set(gblAutoLoad, true)

    This way you can set it to false using the App OnStart editor without having to navigate to the loading screen.

    Then on your button instead of just Navigate('MyStartScreen') you have :

    If(gblAutoLoad, Navigate('MyStartScreen'))

     

  • Imke Profile Picture
    281 on at

    Awesome - that did the trick!
    Thanks a lot @iAm_ManCat , learned so much from your help in this thread!!

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard