Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Filter Gallery on Select on Buttons

(1) ShareShare
ReportReport
Posted on by 289
Hello,
 
I have a Gallery (named as galInspection) where the Items property is set as below. (New or Edited items shows on top within the Gallery using below expression)
SortByColumns(Search('SharePoint List Name', TextInput1.Text, Employee Name, 'Customer Name', Status),"Modified", SortOrder.Descending)
TextInput1 is used to Search the Gallery for Employee Name, Customer Name and Status
 
My requirement is to add 4 Buttons to filter the Gallery on click on this buttons.
 
For Instance: My Status column is a Text Input, which is a calculated field and updates as "In Progress" or "Completed"
 
Add a Button for Status and on click of this button, filter the Gallery which only says "In Progress". In this Button text also show Count of "In Progress". I'm using below expression In Text property 
CountIf('SharePoint List Name', Status="In Progress")
Similarly I need one button for Response Date. On click on this button filter the gallery where Response Date is blank and show the Count in text property of this button.
 
Need assistance on filtering the gallery on click on buttons. Please advise. Thanks!
 
  • Prem4253 Profile Picture
    Prem4253 289 on at
    Filter Gallery on Select on Buttons
     
    Thanks! your solution worked.
     
    You always there to provide solutions to the queries we ask.
     
    Much appreciated.
  • WarrenBelz Profile Picture
    WarrenBelz 145,567 on at
    Filter Gallery on Select on Buttons
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee
  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,567 on at
    Filter Gallery on Select on Buttons
    You need to set a Variable OnSelect of each button - example
    UpdateContext({varStatus: "In Progress"})
    then the Gallery Items
    Filter(
       'SharePoint List Name', 
       Status = varStatus
    )
    The count can remain as you have it.
    One clarification I need is your comment My Status column is a Text Input, which is a calculated field and updates as "In Progress" or "Completed". If this is a SharePoint calculated column, they are not reliably compatible with Power Apps and their use should be avoided.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,567

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard