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 / OnVisible Not Firing
Power Apps
Answered

OnVisible Not Firing

(2) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a rather complex PowerApp that utilizes a multi screen form. I keep runnning into an issue where the OnVisible events will not fire correctly. They usually fire the first time correctly, but if I navigate away from the page and come back later - they will not fire a second time. I have to either restart the entire app or cut the code from the property, navigate away, and then navigate back and then paste the code back in to get the code to fire correctly on the next screen load.

 

It makes no sense as it works correctly sometimes and other times does not fire at all. This only started happening after I added in a process that collects some data on screen visible into a collection. However, this is not the only thing that is not working - everything including simple updatecontext variable statements are not working the second time around.

Categories:
  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    Thanks for the feedback.

    Per testing, the OnVisible works when navigating between screen from my side.

    Besides, would it be possible to put the formula under the Navigate button, instead of the OnVisible property of the screen?

    We could pass the Variables within the Navigate () function:

    Navigate( Screen, Transition [, UpdateContextRecord ] )

    For example:

    Navigate( Details, ScreenTransition.Fade, { ID: 12 , Shade: Color.Red } )

    Function reference:

    Back and Navigate functions in PowerApps

     

    Regards,

    Michael

  • CarlosFigueira Profile Picture
    Microsoft Employee on at

    One thing to notice is that controls are notified of changes in variables that are used in their properties - if the UpdateContext (or Set) call in a screen sets a variable to the same value that it had been set before, then no controls will be notified of it.

     

    For example, if in a screen you have on its OnVisible property this expression:

    UpdateContext({v: true})

    And you have a toggle whose Default property is set to 'v', when you first navigate to that screen, the value of 'v' will be changed from nothing (Blank()) to true, and the toggle will be notified of that change, updating its value to selected (On).

     

    If, in that screen, you change that value by changing the toggle back to unselected (Off), navigate to a different page, then navigate back, the OnVisible handler will set the value of 'v' to true - but that was already the value that it had, so nothing changes and the controls don't get notified of any changes, so the toggle won't be turned on.

     

    If this is your scenario, there are a couple of things you can do. You can force the value of the variable to change:

    UpdateContext({v: false}); UpdateContext({v: true})

    Or if the value is being used for a default value of a control, you can explicitly call the Reset function on the control, to force it back to its default value.

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

    Thank you for answering but neither situation really applies to my situation. This is an actual bug and not a problem in my code. I ended up getting rid of it by simply duplicating the page and deleting the old one - no code changes required.

  • Sagar2016 Profile Picture
    2 on at

    Hello,

     

    I am facing the same issue. On android app, second screen's onvisible event is simply using collect function but it is not working.

    I tried duplicate screen and delete old screen but still I have same issue.

     

    I am not able to understand is that issue with PowerApps android app or bug.

    Any help or pointer is very much appreciated.

    Thanks,

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    In my case, I had the impression that the OnVisible wasn't run because some variable wasn't set, sometime.  I think is a timing problem, but not sure.  Still relatively new to PowerApps.

    I was doing something like this : 

    UpdateContext({varOne:DataCard1.Value})

     

    Somehow, in somecases, my variable was empty. This was a big problem.

     

    I solved my problem by doing this instead : 

    UpdateContext({varOne:Gallery.Selected.MyField.Value}).


    Note : MyField and DataCard1 is the same field.
    Happy PowerApps !

  • rneel Profile Picture
    5 on at

    Duplicating screen fixed it for me too, thanks!


    @Anonymous wrote:

    Thank you for answering but neither situation really applies to my situation. This is an actual bug and not a problem in my code. I ended up getting rid of it by simply duplicating the page and deleting the old one - no code changes required.


     

  • mj2 Profile Picture
    24 on at

    Try using Classic Rendering from App Settings -> Advanced Settings -> (turn off) Improved app rendering.

    After turning off this setting, all started to work for me.

     

    This is certainly a bug and should be fixed before disabling Classic rendering!!!

  • bryan_0226-ag Profile Picture
    53 on at

    I had the same issue. Duplicating the screen did not help. 

    I solved it by adding an Icon that [OnSelect] refreshed the datasource and regenerated the variable containing the data:

     

    OnSelect: Refresh(DataSource);Set(variable,Filter(DataSource, criteria, criteria...);

     

    That solved the issue. Not perfect but it works.

     

     

  • vladimir84 Profile Picture
    322 on at

    This happened to me too, albeit selectively. I was firing two ClearCollect statemets for two sharepoint lists. One collected, the second did not. Your solution of duplicating the page resolved the issue - definitely a bug.

  • stapes Profile Picture
    894 on at

    Yes. I found this too. Especially frustrating as the OnVisible property of the first screen does not fire at all in the debugger until you navigate away & return, resulting in having to collect all the data in the AppStart.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard