Power Apps – Why are variables not on my main screen loading on the app OnStart?

I have two screens in my Power App. One’s the main screen, then a second screen. There’s a bunch of variables on the second screen that must only load after the first screen has fully loaded – i.e. after the app OnStart completes. This was fine so far until today when I made a change on the main screen and since then the app started complaining.

Turns out in the app OnStart I was now checking the status of a variable on the second screen. Turns out though – and this is the key thing I learnt – doing so seems to actually load the second screen in the background, loading all the variables there (not just the one I am checking the status of), and that’s why things were complaining!

Lesson learnt. 🤘