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 / Prevent Dropdown selec...
Power Apps
Answered

Prevent Dropdown selection from changing when navigating away from screen

(0) ShareShare
ReportReport
Posted on by 333

Hi all,

 

Hopefully this is a simple one though I have struggled to find a solution here that matches my scenario;

 

I have a gallery that is currently filtered by a dropdown control, and what I am hoping to do, is stop it from resetting when users move to a different screen and come back. So if they picked "Available" from the dropdown, the gallery only shows items with Available status. Then if they go to a different screen and come back, the dropdown is still showing the same selection of "Available" and therefore the gallery only displays items that have a status of Available.

 

Thanks in advance!

Categories:
  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    Hi @BrendanZ1 ,

    The gallery should not reset just by changing screens unless you have something (probably at Screen OnVisible) to do this.

    Can you please check this.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

  • BrendanZ1 Profile Picture
    333 on at

    Hi @WarrenBelz ,

    The screen has a ClearCollect and Collect function to establish the list for the Dropdown, so that causes the issue I guess as it resets the list. Dont' suppose there is a way around this? Could I use a variable somehow?

     

    The OnVisible is:
    ClearCollect(coljobstatus, {JobStatus: "All"});
    Collect(coljobstatus, JobStatusList.JobStatus);

     

    The Dropdown item property is: coljobstatus

  • Verified answer
    WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    Hi @BrendanZ1 ,

    One option would be to put that code on the control that navigates to the screen (on the previous screen).

    That way when you go back to it from somewhere else, the gallery will not reset.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

    Hi @BrendanZ1 ,

    Based on the issue that you mentioned, I think your thought is right. If you put the ClearCollect formula within the OnVisible property of the screen, whenever you navigate back from another screen, the ClearCollect formula would be executed again, so your coljobstatus collection would be reset.

     

    I agree with your thought, I think a global variable could achieve your needs. Please consider take a try with the following workaround:

    Set the OnChange property of the Dropdown box to following:

    Set(SelectedItem, Dropdown1.Selected.Value)

     

    Set the Default property of the Dropdown box to following:

    SelectedItem

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • BrendanZ1 Profile Picture
    333 on at

    Thanks to both @WarrenBelz and @v-xida-msft for the solution. In the end I used both suggestions to complete this.

     

    I moved my collection execution to the OnStart of the App and then added a variable to maintain the dropdown selection.

    I initially tried the collections as running with the buttons that navigate to the screen but didn't seem to work. At the OnStart I had no worries.

     

    Sorry I couldn't mark both of your suggestions as the solution.

  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    Thanks @BrendanZ1 ,

    You can accept more than one post as the solution if you choose.

  • BrendanZ1 Profile Picture
    333 on at

    Well then - that makes it easy. Done!

     

    Thanks again for the help!

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

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 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard