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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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