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 / using filters for expe...
Power Apps
Answered

using filters for expense app

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi guys,

 

Making an expense app and try to have three buttons that, when pressed, will filter between pending, approved, and both pending and approved (see photo below).

 

CMQuills_0-1684745986449.png

my code is the following: 

ClearCollect(
FilteredItems,
Filter(
LineItems,
Approval = "Pending" && Text(Title) = ApprovalGallerytext.Text Or Approval = "Approved" && Text(Title) = ApprovalGallerytext.Text
)
);
GallerySubmitted.AllItems = FilteredItems

 

It's sadly not working. the chocies in the sharepoint list (which it's connected to) are "rejected", "approved", and "Pending". Ignore rejected as i dont want a filter for that. 

 

Where am I going wrong? any help would be greatly appreciated. Thanks!

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    Hi @Anonymous ,

    I think all you need is this

    ClearCollect(
     FilteredItems,
     Filter(
     LineItems,
     Title = ApprovalGallerytext.Text &&
     (
     Approval = "Pending" ||
     Approval = "Approved"
     )
     )
    );

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz ,

     

    Thanks for your quick response. I think I initially tried this but arrived at an error of 'Incompatable types for this comparison. These types cant be compared: Record, Text.' Let me know what you think!

  • WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    @Anonymous ,

    I was simply using your values assuming them to be correct - I suspect Approval is a Choice field, so you need Approval.Value - unless ApprovalGallerytext is in a Gallery so you would need

    YourGalleryName.Selected.ApprovalGallerytext

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz ,

     

    Sorry for me misunderstanding. The following has no errors but doesnt seem to filter how I'd like: 

    ClearCollect(
    FilteredItems,
    Filter(
    LineItems,
    Title = ApprovalGallerytext.Text &&
    (
    Approval.Value = "Pending" ||
    Approval.Value = "Approved"
    )
    )
    )

     

    The approvalgallerytext is a part of the gallery as sen in the photo below. 

    CMQuills_0-1684759556444.png

     

  • WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    @Anonymous ,

    How do you want it to filter differently from what it is doing now ?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz ,

     

    Sorry for the late response. Currently, Approved items are not in fact being shown in the gallery which confuses me. If i manually change the items in the sharepoint list, only rejected and pending items will show. ThereforeI think the filter does indeed work but the 'approved' items are not being displayed.

     

    CMQuills_0-1685522876717.png

    These two items arent showing up in gallery

  • WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    Hi @Anonymous ,

    You also have this additional filter

    Title = ApprovalGallerytext.Text

    so maybe that is taking out some items. The code should certainly otherwise show records with an Approval of Approved

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 94

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard