web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / On Select on Button (w...
Power Apps
Suggested Answer

On Select on Button (which is formulized) filter the Gallery

(1) ShareShare
ReportReport
Posted on by 697
Hello,
 
Below is one of the formula I received for my last post. Which is working as expected.
 
Now I'm looking to achieve my second requirement. Below is the formula that I've applied to one of my button called "Receipt Date":
CountIf('SPListName', IsBlank('Receipt Date'))
It counts Blanks from the Receipt Date column. I also have more 3 buttons with different column name.
 
So my requirement is: when I click "Receipt Date" button, the Gallery should filter all the Blank ones referring "Receipt Date column"
 
Similarly when I click "Invoice No." or "Invoice Date" or "License No." button it should filter all the Blank ones
 
Appreciate if someone could assist.
 
Thanks,
Prem
Categories:
  • Suggested answer
    jpespena Profile Picture
    335 on at
    Hi,
     
    You can add this code on the OnSelect property of the button to make it have a toggle-like function:
    If(
        locFilterBlankReceiptDate,
        UpdateContext({locFilterBlankReceiptDate: false}),
        UpdateContext({locFilterBlankReceiptDate: true})
    );
     
    On the gallery, apply this to filter blank values for the corresponding column:
     
    Filter(
        DataSource,
        Or(
            !locFilterBlankReceiptDate,
            ReceiptDate = Blank()
        )
    )
    With this code, it looks if the local variable locFilterBlankReceiptDate is true then filter those with blank values, if false then it shows all the items.
     
    You can do the same to other columns with their own buttons like:
    Filter(
        DataSource,
        Or(
            !locFilterBlankReceiptDate,
            ReceiptDate = Blank()
        ),
        Or(
            !locFilterBlankInvoiceNo,
            InvoiceNo = Blank()
        )
    )
     
     
     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard