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

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

 

1 ACCEPTED SOLUTION

Accepted Solutions

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
)
)

 

View solution in original post

19 REPLIES 19
Gochix
Solution Sage
Solution Sage

Hi @Virikefe22 ,

 

Please share a gallery items code with us for the ShowAll issue.

Regarding the gallery count use the following:

CountRows(Gallery.AllItems)

 

Ricardo_Costa
Resolver I
Resolver I

If I understood , you want show all items what mean no filtering.

in show all button you can do like this: Set(varFilter,"All")

 

in gallery items (believe you are filtering by varFilter) you need to test

 

If(varFilter = "All", Datasource, Filter(Datasouce, Status = varFilter))

 

Virikefe22
Helper IV
Helper IV

Thanks @Gochix ,

I don't understand what you mean by "gallery items code".

For the other btns (New, Pending and Completed, I used these to filter: 

Set(varFilter,"New") | Set(varFilter,"Pending") | Set(varFilter,"Completed") and it's working for them.

Just the ShowAll that's the issue.

 

As for the CountRows... IT WORKED!!! Many thanks.

I applied it like this:

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

 

But the last "=" on the line is showing error.

Hi @Virikefe22 ,

 

 

If(varFilter = "All", SPlist, Filter(SPList, status = varFilter))

 

status will be your column in your data source where status is stored as "New", "Pending" and "Completed"

 

I've checked the code at my end and the formula works. So if this doesn't work for you then you have to adjust it for your data source and column name.

If your status field is a choice field you need to put status.value

Not still working yet Bro @Ricardo_Costa  @Gochix 

What kind of error do you get from the last "=" ?

can you share the error message?

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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