cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Amik
Advocate I
Advocate I

Gallery filter selections reset when navigating to form view/switching screens

Hi,

 

I have a few dropdown filters on a Gallery. 

 

Upon selecting some dropdown options in the Gallery, then navigating to the Form screen, and then navigating back to the Gallery screen, the dropdown filter selections are reset to default values.

 

Is there any way to pass the filter selections onto a global variable or any other means, so that when I navigate back to the Gallery from the Form screen, the dropdown selections do not change?

 

Best regards,

AmiK

 

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User III
Super User III

@Amik

You could put some code like this in the OnChange property of the dropdown to store the selection in a variable.

Set(varFilterColumn1, Dropdown_Column1.Selected.Value)

 

Then put the variable in the Default property of the dropdown.  Now the value will be retained now matter if the selection is lost.

varFilterColumn1

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
mdevaney
Super User III
Super User III

@Amik

You could put some code like this in the OnChange property of the dropdown to store the selection in a variable.

Set(varFilterColumn1, Dropdown_Column1.Selected.Value)

 

Then put the variable in the Default property of the dropdown.  Now the value will be retained now matter if the selection is lost.

varFilterColumn1

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Thank you for the quick response @mdevaney . Unfortunately, when navigating back to the Gallery from the Form screen, the dropdown still resets back to the first item in the drop down menu rather than the selected item.

 

To check if the function is working correctly, I added a Label into the Form screen and referenced it back to the dropdown value in the Gallery. The Label control correctly returned the selected filter value. The value is just not appearing correctly when navigating back to the Gallery.

 

Any ideas?

I found a post with the same issue and it turns out the solution was not working because I was already using a ClearCollect and Collect function on the dropdown control. The steps provided in the below thread resolved that issue.

 

https://powerusers.microsoft.com/t5/Building-Power-Apps/Gallery-filter-selections-reset-when-navigat...

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (94,154)