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 / OnHidden function now ...
Power Apps
Unanswered

OnHidden function now performs unexpectedly when navigating page

(1) ShareShare
ReportReport
Posted on by 19

We have used the OnHidden feature throughout our app to clear variables and collections as we navigate from page to page. Just recently, it seems that it may be clearing our variables as we are navigating on the same page. E.G. scrolling through a gallery and selecting different ones, seems to trigger the OnHidden function when PowerApps queries back to the DB. 

 

This recently just started happening and only occurs when in Play mode outside of PowerApps Studio.

 

Thank you,

Ryan

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

    Hi @PowerAppJammer,

     

    Thanks for the feedback.

    According to the description of the OnHidden property, it should not perform the corresponding action unless the user navigates away from the screen.

    Besides, if the variables are context variables, then there is no need to clear them, as the scope of it is only within the current screen.

    For Collection and the Global variable, consider to clear them after the navigate funciton.

     

    Regards,

    Michael

  • PowerAppJammer Profile Picture
    19 on at

    Hi @v-micsh-msft,

     

    Thanks for the response. I understand the functionality of the OnHidden property and we are using it to clear variables after we navigate away due to sharing one screen for multiple views/functions. The issue still seems to stem from PowerApps interpreting quick navigation or scrolling of the gallery as leaving the page, ultimately executing the OnHidden function as well as the OnVisible function. Both of these functions then seem to fire off unexpectedly and have caused issues for the end-users.

    Again this just started happening within the last two weeks, and only while opening the app outside of PowerApps studio. I will look into clearing context variables or other collections upon all navigation options from leaving the page.

     

    Thank you,

    Ryan

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
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard