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

Notifications

Announcements

Community site session details

Community site session details

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

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

(1) ShareShare
ReportReport
Posted on by 652
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:
I have the same question (0)
  • 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard