cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerAppsHori
Helper I
Helper I

I Want a Drodpown Selection to Reset Gallery and Deselect Selected Gallery Item

I have a gallery and a dropdown. 

The gallery shows a list of tickets. The dropdown lets you filter the gallery based on three ticket statuses: Active, Complete, Cancelled.

 

The filter works just fine. However, a user is complaining that the most recent selected ticket stays on screen even when you filter to a different type of ticket. Meaning if he selected a ticket that was Active and then filtered to Complete tickets, his Active ticket would still be showing.

 

I watched Shane's video here where he shows how to make a button that resets a gallery and deselects what is currently selected. I have my gallery setup with the same varRecord variable he uses and when I setup a button with his code on the OnSelect property, it works. Here's the code: 

Set(varRecord, Blank()); Reset(Gallery)

 

However, if I use that same code on the OnSelect or OnChange property of the dropdown nothing happens. Is there a way to trigger that same code or action when the dropdown selection changes?

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
PowerAppsHori
Helper I
Helper I

OMG I feel so dumb. So sorry. I had an invisible dropdown on top of the one I needed to change. So I kept selecting that one and changing its properties. Finally realized when I selected the correct dropdown from the left list the original code from Shane’s video worked fine. Gonna mark this as fixed.

View solution in original post

6 REPLIES 6
StalinPonnusamy
Community Champion
Community Champion

Hi @PowerAppsHori 

 

Set the gallery Default property to {}

 

StalinPonnusamy_0-1630030689448.png

 

So whenever you change the dropdown, items on the gallery should reset with the selection clear.

 

Sample: (Below one shows after change the dropdown)

StalinPonnusamy_1-1630030923225.png

 

 

I also need it to default to active when folks first enter the page. Is there a way to do both?

StalinPonnusamy
Community Champion
Community Champion

Hi @PowerAppsHori 

  • Set onvisible of the screen to
  • Reset(DropdownName);Set(DropdownDefault,"Active")
  • Set the default property of Dropdown to DropdownDefault

Sorry I misunderstood. Thought you wanted me to put {} in the dropdown default property. Unfortunately my gallery default has a LookUp:
LookUp(‘SharePoint Source’, ID = varIDTicket). 

I believe this helps with direct linking to tickets from email notifications. Is there some other way to handle this?

PowerAppsHori
Helper I
Helper I

OMG I feel so dumb. So sorry. I had an invisible dropdown on top of the one I needed to change. So I kept selecting that one and changing its properties. Finally realized when I selected the correct dropdown from the left list the original code from Shane’s video worked fine. Gonna mark this as fixed.

View solution in original post

StalinPonnusamy
Community Champion
Community Champion

Hi @PowerAppsHori

 

As per your ask,

1. The First one, to deselect the gallery item whenever the gallery refreshed

2. The Second one, To set default value for the dropdown

 

Both should work. And we can set the LookUp(‘SharePoint Source’, ID = varIDTicket) to preselect the gallery.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,845)