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 / Reset gallery when ent...
Power Apps
Unanswered

Reset gallery when entering screen

(0) ShareShare
ReportReport
Posted on by 55

I have a report screen where users can select a report to view. When they navigate to that screen, the gallery is remembering the results from the previous visit. The dropdown box is what populates the gallery. 

 

I currently have the navigation set to:

 

Navigate(StatusScreen); Reset(dd_CurrentStatus_1); Reset(ReportGallery_2)
 
Do I need to add a variable too?
 
Thanks!
Categories:
I have the same question (0)
  • rebeccas Profile Picture
    2,591 on at

    Reset doesn't work across screens good like that. You would be better to put it on your screens OnVisible. Leave the Navigate how you have but move the resets over the screen with the galleries OnVisible. 

     

    Also, I prefer using UpdateContext({ResetFields:!ResetFields}) and then on everything you want to reset on the Reset property you simply put ResetFields

     

    But just moving to the same screen might do it.

  • kidvallejo Profile Picture
    100 on at

    I would use a variable... on the selection screen (onvisible) :

     

    Set(variable1,"");Reset(dd_CurrentStatus_1)Reset(ReportGallery_2)

     

    Set(variable1,dd_CurrentStatus_1.Selected.Value);Navigate(StatusScreen); Reset(dd_CurrentStatus_1); Reset(ReportGallery_2)

     

    UpdateContext will work too!

  • tjtaylor Profile Picture
    55 on at

    Thanks! I had update context but it wasn't working.

     

    I tried the variable suggested but the gallery is still showing results even though the dropdown is "". Here's what I have for my gallery that displays the results of the current status dropdown:

     

    Sort(Filter(DataSource, CurrentStatus.Value = dd_CurrentStatus_1.Selected.Value), Organization, Ascending
    )
     
     
  • rebeccas Profile Picture
    2,591 on at

    A dropdown doesn't work well if you want them to be able to choose nothing. It won't really stay with a blank value and if they click on something it will never let them put it back to nothing again. Combo boxes work better for this. 

     

    That being said I think your issue might be more on what you have for the items of you gallery, you need to put an if statement in there or something that says to show everything if they haven't selected anything yet...change that to:

     

    If(dd_CurrentStatus_1.Selected.Value="",
    Sort(DataSource, Organization, Ascending),

    Sort(Filter(DataSource, CurrentStatus.Value=dd_CurrentStatus_1.Selected.Value),Organization, Ascending)

    )

     

    This will tell it that if the drop down doesn't have anything selected yet show everything...otherwise do the filtering of it.

  • tjtaylor Profile Picture
    55 on at

    It's still not working. Is it because I have a hypen (-) in the dropdown menu and a hyphen (-) as an organization name? I have other screens that reset the value to blank, just not on my reports screens.  

     

    Here's where users navigate from:

    InkedReportScreen_LI.jpg

     

    Here's the screen that continues to show the gallery list even though nothing is selected in the dropdown:

    CurrentStatusScreen.PNG

  • rebeccas Profile Picture
    2,591 on at

    Using a hyphen is one way around it not allowing for a blank. If you are using that option then instead you need to do:

     

    If(dd_CurrentStatus_1.Selected.Value="-",
    Sort(DataSource, Organization, Ascending),

    Sort(Filter(DataSource, CurrentStatus.Value=dd_CurrentStatus_1.Selected.Value),Organization, Ascending)

    )

    --- This is saying if the hyphen is selected don't filter, otherwise do. Same thing, just a variation on it. Make sure you get space or no space correct on that part in the quotes...it needs to match exact.

  • tjtaylor Profile Picture
    55 on at

    My CurrentStatus in my datasource is a Choice field. How would I do a combo box for that?

  • rebeccas Profile Picture
    2,591 on at

    It would be Items=Choices(DataSource.FieldName) and turn off the "Allow Multiples" if it defaults to on because then it will interfere with the filtering abilities. 

  • tjtaylor Profile Picture
    55 on at

    So then my gallery would filter on the combo box like this?

     

    Sort(Filter(DataSource, CurrentStatus=ComboBox3.Selected), Organization, Ascending
    )
  • rebeccas Profile Picture
    2,591 on at

    If you want it to show everything when nothing is selected in the combo box you would still need to do the if statement to allow it to not have a filter and for the filter part it would be ComboBox3.Selected.Value and the if statement part would be If(IsBlank(ComboBox3.Selected.Value), 'no filter', 'filter')

     

    The reason the combo box works better than the drop down (in my opinion of course) is they can clear it out and select nothing but also because it has searching ability. 

     

    It will work with either the combo box or the drop down though you just have to use the if statement or the gallery will not show anything until something is selected from the box (whichever you use). 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard