cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cperry07
Helper I
Helper I

Filtering Gallery By Buttons

Hello,

 

I have a SharePoint list that holds different training dates. I would like to have buttons setup for the following status':

 

"All"

"Pending"

"Completed"

"Canceled"

 

My intent is to filter a gallery based off of these buttons.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @cperry07,

Based on the issue that you mentioned, do you want to filter the Gallery based on the different status?

Could you please tell me that if the Status column is a Choice or Text?

I just assume that it is a Choice column, please check as below.

Add buttons for different status filtering, set OnSelect as below:

ClearCollect(ToggleCol,Filter(SPList1,SingleChoice.Value="Pending")) // Filter the Pending 
ClearCollect(ToggleCol,Filter(SPList1,SingleChoice.Value="Completed")) // Filter the Completed
ClearCollect(ToggleCol,Filter(SPList1,SingleChoice.Value="Canceled")) // Filter the Canceled
ClearCollect(ToggleCol,Filter(SPList1,SingleChoice.Value="All"))

Set the Items property of the Gallery as below:

ToggleCol

One more question, if the "All" means all the status and do not need to filter the specific status, please modify the formula as below:

ClearCollect(ToggleCol,SPList1)

Note that the SPlist1 is my data source, please replace it with yours.

Hope it could help.

Regards,

Qi

View solution in original post

6 REPLIES 6
rubin_boer
Super User
Super User

hi @cperry07 you can add the four buttons and add the filter statement to each one ad needed.

Button one:

Text = "All"  

OnSelect = Filter(YourGallerySource,FilterColumns = "All")

 

and do the same for the other buttons

 

Hope this helps

 
v-qiaqi-msft
Community Support
Community Support

Hi @cperry07,

Based on the issue that you mentioned, do you want to filter the Gallery based on the different status?

Could you please tell me that if the Status column is a Choice or Text?

I just assume that it is a Choice column, please check as below.

Add buttons for different status filtering, set OnSelect as below:

ClearCollect(ToggleCol,Filter(SPList1,SingleChoice.Value="Pending")) // Filter the Pending 
ClearCollect(ToggleCol,Filter(SPList1,SingleChoice.Value="Completed")) // Filter the Completed
ClearCollect(ToggleCol,Filter(SPList1,SingleChoice.Value="Canceled")) // Filter the Canceled
ClearCollect(ToggleCol,Filter(SPList1,SingleChoice.Value="All"))

Set the Items property of the Gallery as below:

ToggleCol

One more question, if the "All" means all the status and do not need to filter the specific status, please modify the formula as below:

ClearCollect(ToggleCol,SPList1)

Note that the SPlist1 is my data source, please replace it with yours.

Hope it could help.

Regards,

Qi

View solution in original post

Sorry for the delayed response, thank you so much! I have been looking everywhere for a solution! Sometimes it's the easiest things that are overlooked! I am thankful for this community, it really has attributed to a lot of success on my end!

I cannot tell you how many tabs I have opened trying to get something that worked, and yours is the first simple solution that does!  Bless you!

@v-qiaqi-msft , one quick question about this solution.  When I have Items on my gallery set to my variable ToggleCol, when the solution first loads, the gallery is blank until you click on an All button.  How do I resolve this so that all data shows when the app is first loaded?

 

Thanks!

OK, I have this all functioning. I also would like to create a drop down where people can select a particular training date. I am pulling the information from a Date and Time field in my SharePoint list. Is there a way to accomplish both? I tried using a double pipeline with no success.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (20,606)