cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FelipeCaru
Advocate V
Advocate V

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

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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. 

View solution in original post

2 REPLIES 2
FelipeCaru
Advocate V
Advocate V

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?


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. 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (46,912)