cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
daroot
Level 8

Filter Gallery List

Hi All,

 

I tried to created the Filter for the Gallery items. This filter will look the value for Pending, Declined, and Approved.

All this filtering is working except the All button.

 

PApps.pngBut for the All button, the filtering seem not working:

all.png

Here the code I used on the Gallery:

 

Sort(Filter('Approval' ,Status = _requestTypeFilter), Created, Descending)

Any advice how to solve this, when a users tap All button will display the all List inside the Gallery.

 

Thanks,

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
daroot
Level 8

Re: Filter Gallery List

Hi @dinusc,

Thanks for the reply, but it's not working and got following error

 

err.png

 

The OnSelect:

items.png

 

Maybe something wrong from my side, I used the the poroperty:

 

Items: Table({Filter: "All"}, {Filter: "Pending"}, {Filter: "Approved"}, {Filter: "Declined"})

for the GalleryFilters.

 

Any advice?

 

 

4 REPLIES 4
Microsoft Employee

Re: Filter Gallery List

Hello @daroot,

 

The following should work:

If(IsBlank(_requestTypeFilter), Sort(Created, Descending), Sort(Filter('Approval' ,Status = _requestTypeFilter), Created, Descending))

And then paste the following formula in the "OnSelect" property for the "All" button: 

Set(_requestTypeFilter, "")

daroot
Level 8

Re: Filter Gallery List

Hi @dinusc,

Thanks for the reply, but it's not working and got following error

 

err.png

 

The OnSelect:

items.png

 

Maybe something wrong from my side, I used the the poroperty:

 

Items: Table({Filter: "All"}, {Filter: "Pending"}, {Filter: "Approved"}, {Filter: "Declined"})

for the GalleryFilters.

 

Any advice?

 

 

daroot
Level 8

Re: Filter Gallery List

Finally, I got it working based on @dinusc advice.

 

What I did is, on the Gallery Request:

Items: If(IsBlank(_requestTypeFilter), Sort(Approval, Created, Descending), Sort(Filter('Approval' ,Status = _requestTypeFilter), Created, Descending))

and than on the Gallery Filters:

OnSelect: If(ThisItem.Filter <> _requestTypeFilter, Set(_showDetails, false));
Set(_requestTypeFilter, ThisItem.Filter)

Is the good way to do something like this? But it's worked Smiley Very Happy

Microsoft Employee

Re: Filter Gallery List

This looks correct to me. I'm glad you got it working.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 353 members 4,597 guests
Please welcome our newest community members: