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 / Load galleries and som...
Power Apps
Answered

Load galleries and some formulas before using a button or from start

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello all,

I have a question. Is it possible to have some gallery or formulas to load when the app is opened? or in a screen before it? Asking this because in my app I have the following:

  • Home: choose criteria
    • Criteria: this month - choose starts this month / ends this month
      • Start/end this month screen

However, in the second one I have a popup that if there is no item in the next gallery, popup saying so:

If(CountRows(galleryIMA.AllItems)<>0, Navigate(inicianMesActual,ScreenTransition.Cover), UpdateContext({Popup:true}))

However, did a test today and when the app was opened fresh from a new session in other browser, the button when clicked showed the popup with "no item", however, when clicked again, it went to the screen with the gallery which does have items, which makes me think that it was because the formula was not calculated before. This leads me to the question: is it possible to "preload" somewhere else (before this) that formula or gallery, as to avoid that error?

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Add-on Q:
    Having the same formula but replacing the CountRows(x) with a variable, work? Such as:

    If(CountRows(VARIABLE)<>0, Navigate(inicianMesActual,ScreenTransition.Cover), UpdateContext({Popup:true})

    With variable = 

    galleryIMA.AllItems

    So, on AppStart that would happen so later the screen doesnt has to calculate again and avoid the false positive of the popup?


  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I managed to solve this by having the formula on the "OnStart" of the app, with the "OnStart" being = 

    CountRows(galleryIMA.AllItems)

    That way it is already calculated before clicking the button, thus avoiding having a false positive pop up. 

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 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard