web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Selective screen reset...
Power Apps
Unanswered

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

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @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.

  • Rob_CTL Profile Picture
    on at

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard