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

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 II
Helper II

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
Super User
Super User

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
Super User
Super User

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 II
Helper II

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.

StalinPonnusamy
Super User
Super User

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,646)