Showing results for 
Search instead for 
Did you mean: 
Advocate II
Advocate II

How to Clear Gallery after Navigating to Home Screen

Hi -

I was able to navigate from one screen to another and clear the fields using:

Screen1: Navigate(CompoundingRecord,None) & Reset(SearchBox) & Reset(Gallery1)

Screen2: Navigate(HomeScreen, ScreenTransition.Fade) & Reset(SearchBox) & Reset(Gallery1)

Item on Screen2: was Gallery1.Selected but now I changed to 


Item on Screen2 to: Filter(DrugTBL,ID=conDrugID)


What should I put in place of Resect(Gallery1). I have the galleries defaulted as {}


Thank you


Frequent Visitor

Save your results in a collection if not already built that way.


Afterwards you can clear() your collection at e.g. onVisible or at onHidden or with a button.


If this does not help you, screenshots etc. are always quite helpful to understand the problem better.



Based on the issue that you mentioned, do you want to clear the content from the Gallery1 after navigating to the HomeScreen?

Could you please share a bit more about the scenario:

  1. Is there an EditForm in the HomeScreen, how you configure the HomeScreen? 
  2. What is the data type of the 'conDrugID'?

I have a test on my side, please take a try as below.

Set the OnSelect property of the reset button as below:


Navigate(HomeScreen, ScreenTransition.Fade)&&Set(ResetGallery,false)&&Reset(SearchBox)


Set the Items property of the Gallery1 as below:




Best Regards,



Hi @v-qiaqi-msft 

Is there an EditForm in the HomeScreen, how you configure the HomeScreen?  I use the notebook icon to navigate from HomeScreen to CompoundingRecord.



What is the data type of the 'conDrugID'? conDrugID is the primary key on from a Sharepoint list.


I want to clear content of Gallery2 on CompoundingRecord when I navigate to Homescreen.  I was able to do this when I had Gallery2 = Gallery 1.Selected but when I changed to Gallery2 to Filter(DrugTBL,ID=conDrugID) the naviagtion no longer works.




I am not sure if I should just use gallery1.selected again? I was trying to get rid of an inefficient delay loading but seem to have created more problems. 


Thanks again



Hi @HendrikKl -

I do not know how to save my results in a collection. How do you create a collection?





Based on your need, I think a collection may be a better and efficient solution.

Add a Button and set the OnSelect property  as below:


ClearCollect(Col1, Filter(DrugTBL,ID=conDrugID))


Set the OnSelect property of the navigation button as below:




Set the Items property of the Gallery2 as below:




Please check if the above formula could solve your problem.


Best Regards,



Hi @v-qiaqi-msft 


I added button to Homescreen but is there a way to not have this button? 


But when I navigate to CompoundingRecord it is now blank. I am not sure what to change below to get the selected ID to display

Navigate(CompoundingRecord, ScreenTransition.Fade, {conDrugID:ThisItem.DrugID})



Thank you again.

I really appreciate everyone's input as I am learning powerapps via this forum, the school of Google, and Youtube.



Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (15,798)