cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Virikefe22
Helper V
Helper V

ShowAll Gallery Filter Btn

Hello,

I created these filter btns: New | Pending | Completed

Each one of them filters the gallery and show the corresponding item(s)

All the filter btns are set to variables Set(varFilter,"New") | Set(varFilter,"Pending") | Set(varFilter,"Completed")

 

Question:
1. How do I set the Show All tab to show all the (New, Pending & Completed) items.

Note: when I log in afresh, it shows all the items but after clicking on the New, Pending & Completed tab, I need to find a way to return all of them showing on the screen all again.

 

2. How do I code gallery count for each tab selected? Say for instance, if there are just 2 New items, 3 Pending Items and 4 Completed items respectively, when I click on the New, I should see a label by the side showing the total number of item selected.

Onload of the screen, all the items show

Virikefe22_0-1660745717438.png

 

19 REPLIES 19
Virikefe22
Helper V
Helper V

Ok now, I modified to "Status.Value" and the red-underline in the last "=" was cleared off. Meaning code is clean. But clicking on the button is still not doing anything when app is executed.

 

Here is what I did:

 

If(varFilter = "All", 'MyDataSource', Filter('MyDataSource', Status.Value = varFilter))

you can try a different approach like this.

 

Filter('MyDataSource', Status.Value = If(varFilter = "All", Status.Value, varFilter))

 

this should be in gallery items

Still didn't work @Ricardo_Costa 

Virikefe22
Helper V
Helper V

None of these approaches worked @Ricardo_Costa @Gochix Please see inbox.

Ricardo_Costa
Resolver I
Resolver I

can you share a screenshot of it?

Here's it... it's actually not showing any error anymore... code clean and this is applied to OnSelect of the ShowAll btn

Virikefe22_1-1660756893169.png

 

 

Ok, I think I got it.

 

this code "Filter('MyDataSource', Status.Value = If(varFilter = "All", Status.Value, varFilter))" should be in the Gallery Itens properties and in the button you need just to put Set(varFilter,"All")

 

Ok, now I understand but add this to the Filter code to this gallery, it's showing error. Here is it:

SortByColumns(
If(
IsBlank(varFilter),
Filter(
'MyDataSource',
TextSearchBox1_1.Text in Recipe || TextSearchBox1_1.Text in 'Batch No' || TextSearchBox1_1.Text in Date || TextSearchBox1_1.Text in Operator
),
Filter(
'MyDataSource',
TextSearchBox1_1.Text in Recipe || TextSearchBox1_1.Text in 'Batch No' || TextSearchBox1_1.Text in Date || TextSearchBox1_1.Text in Operator,
'Slury Status'.Value = varFilter
)
),
"Created",
If(
SortDescending1,
Ascending,
Descending
)
)

 

That's the default code, that's not throwing error.

 

Now, I tried to add this very line: "Filter('MyDataSource', Status.Value = If(varFilter = "All", Status.Value, varFilter))" but I get errors everywhere.

 

So kindly look into the above code (without errors) and add this "Filter('MyDataSource', Status.Value = If(varFilter = "All", Status.Value, varFilter))" to it let me apply and see how it goes.

 

Thanks

 

Try something like:

 

SortByColumns(
If(
IsBlank(varFilter),
Filter(
'MyDataSource',
TextSearchBox1_1.Text in Recipe || TextSearchBox1_1.Text in 'Batch No' || TextSearchBox1_1.Text in Date || TextSearchBox1_1.Text in Operator
),
If(varFilter = "All",'MyDataSource', Filter('MyDataSource', 'Slury Status'.Value = varFilter))
),"Created",
If(
SortDescending1,
Ascending,
Descending
)
)

 

Virikefe22
Helper V
Helper V

That! @Gochix It worked!!! Show All btn now works perfectly as desired.

Many thanks to you both @Gochix @Ricardo_Costa 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,658)