Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Selective screen resets depending on navigation source?

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I have an app that has a search box on the screen, there is a gallery that reacts to the words that are entered into the search box.  When the screen loads I reset the search box so it hides the gallery and the user has a clean interface to search from.  The items in the gallery have a button that navigates to another screen, this new screen uses the selected item from the search screen to display data.  All straightforward so far.

 

Now the complicated bit, I want to change the on visible of the search screen to react differently depending where the user has navigated from.  By this I mean if the user clicks a button from a different page within the app to go to the search page it will load and reset the search box so that the interface is clean.  However if the user has performed their search and clicked on an item and presses a "Back" button it should return them to the search screen but this time it doesn't execute the reset on the search box so their previous search results are still visible.

 

I've been playing with UpdateContext but this doesn't appear to work across screens, or at least I can't get it to work across screens.

 

Any help or thoughts gratefully received.

Rob

  • Rob_CTL Profile Picture
    on at
    Re: Selective screen resets depending on navigation source?

    @RandyHayes ah, lightbulb moment - thanks that really helped point me in the right direction

  • Verified answer
    RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: Selective screen resets depending on navigation source?

    @Rob_CTL 

    You can actually utilize the context variable for this.  If your search screen uses a context variable such as lclResetScreen to determine if the screen should be reset, then you can pass this back from another screen.  You can't use the Back() function on your other screens, but you can use the Navigate to do so.

    Ex.  Navigate(yourSearchScreen, None, {lclResetScreen:false})

    This will set the context variable on the search screen to false.

    Perhaps you can work this into your thought process.

     

    I hope this is helpful for you.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 110 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 77

#3
stampcoin Profile Picture

stampcoin 52

Overall leaderboard