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 / Navigate to current sc...
Power Apps
Answered

Navigate to current screen (or refresh entire screen)

(0) ShareShare
ReportReport
Posted on by

Is there a way of either navigating to the the screen you're currently on or at least triggering the OnVisible() function again? I say this because Navigate( SomeScreen), where "SomeScreen" is the currently active screen does nothing.

 

The use case is that we have a complex screen which uses data from multiple data sources (so obviously we don't use the simple Form control). We perform complicated de-serialisation in the OnVisible() function to get the data from SQL into a form which PowerApps controls can consume. 

 

There's a global "current record" variable which has many foreign keys attached which drive the behaviour of the various groups of screen controls according to a bunch of business rules. This all works very efficiently at the moment.

 

To add functionality to a new button on this screen which would allow the user to jump to another master record, we set the global record primary key and then tried to Navigate() to ourselves, so that all the code in OnVisible() can run again.

 

It would be ridiculous to replicate all the OnVisible() code in the button's OnSelect() function. Surely there's a cleaner way?

Being able to add custom behaviour functions to screens (as we can with components) would solve this.

Categories:
I have the same question (0)
  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    Without knowing your app as well as you do, here's a crude solution: hide a timer on the screen that autostarts and repeats, and move your OnVisible code to the OnTimerStart or OnTimerEnd property. Set the duration for your desired refresh rate, giving your data connections enough time to work.

  • Verified answer
    v-albai-msft Profile Picture
    Microsoft Employee on at

    Hi @MarrinerDev ,

    Solution provided by @BCLS776 may cause slow performance issue. If you have lots of actions inside OnVisible, repeat all these actions within a certain duration may increase data loading. 

     

    So I would suggest you add a new screen(or in a existing screen, for example, called Screen2) with a Timer control. Then set its:

    Duration= 1000

    AutoStart=true

    OnTimerEnd = Back()

    valbaimsft_0-1625646636334.png

    valbaimsft_2-1625646764270.png

    Then on your original screen, add a Navigate button, set its OnSelect=Navigate(Screen2).

    This time, each time you click the button to navigate to Screen2, the timer control will work and send you back after one second, and also, actions inside OnVisible will run again.

    Best regards,

    Allen

  • jmurteira Profile Picture
    20 on at

    Hello, I was having the same problem and the post marked as solution didn't work for me.

     

    But with the solution provided from @BCLS776 worked perfect!!! Thanks a lot!

  • Verified answer
    PowerAppsDeveloper Profile Picture
    9 on at
    To avoid using the timer, just put all of your OnVisible code into an invisible button's OnSelect event. Then, call Select(btnName) in the screen's OnVisilble event, and anywhere else you need to use it. 

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard