cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Digital
Super User
Super User

OnVisible of screen not working

I have a formulae in the OnVisible property of the app's first screen. It sets context variables that I use to show/hide elements.

 

If(
    !varUserHasApps,
    UpdateContext({varEditMode: true, varListEdited: true}),
    UpdateContext({varEditMode: false, varListEdited: false})
)

 

In preview mode it works as expected and displays the items where varEditMode=false. If I play the app or view in browser it is executing the true condition instead of the false condition.

 

To test I added an extra screen and buttons to navigate back and forth. If I navigate to the 2nd screen and back again the formulae runs as expected.

 

varUserHasApps is set in the OnStart. It is set to either true or false depending on a collection containing data.

 

If(
    IsEmpty(colSavedApps),
    Set(varUserHasApps,false),
    Set(varUserHasApps,true)
);

 

Wondering if this is a bug or I'm missing something?

10 REPLIES 10
SoggyGibblets
Frequent Visitor

Interesting. The year long issue we had seemed to indicate that the variable wasn't initially created maybe due to some form of optimisation. Referencing controls from other screens is now frowned upon and with settings for "keep visited screens in memory" looks like they'll break it if they haven't already.

 

How old is your app? We have a few that are more than 4 years and looking at a total re-write.

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,574)