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 / Trying to filter based...
Power Apps
Unanswered

Trying to filter based on Status of specific Item

(0) ShareShare
ReportReport
Posted on by

Hi i'm trying to Filter Items with the specific status when they press a Button.

 

So if they press the Button 'New' only the Items with the Status 'New' should show up, the same should happen with the other three Buttons.

 

I'm using a Globalvariable for this which is called "ExpensesStatus".

I just don't understand how to filter it.

 

Current Gallery Items

SortByColumns(Filter(Expenses, StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

Current Button

Set(ExpensesStatus,"New")

Globalvariable

Set(ExpensesStatus,"New");
Set(ExpenseSorting,Descending);

ClearCollect(NewReports,Filter(Expenses,Status.Value = "New").ID);
ClearCollect(ApprovedReports,Filter(Expenses,Status.Value = "Approved").ID);
ClearCollect(ExportedReports,Filter(Expenses,Status.Value = "Exported").ID); ClearCollect(DeclinedReports,Filter(Expenses,Status.Value = "Declined").ID);
Refresh(Expenses)

Thanks

Powerapps.png
Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    HI @KarlBurg ,

    Could you please share a bit more about your scenario?

    Do you want to filter your Gallery items based on which button do you press? And display all records within your Galley in default?

     

    Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

    Set the OnSelect property of the "New" button to following:

    Set(ExpensesStatus,"New")

    Set the OnSelect property of the "Exported" button to following:

    Set(ExpensesStatus,"Exported")

    Set the OnSelect property of the "Approved" button to following:

    Set(ExpensesStatus,"Approved")

    ...

    Set the Items property of the Gallery to following:

    If(
     IsBlank(ExpensesStatus),
     SortByColumns(
    Filter(Expenses, StartsWith(Title, TextSearchBox1.Text)),
    "Title",
    If(SortDescending1, Descending, Ascending)
    ), SortByColumns(
    Filter(
    Expenses,
    StartsWith(Title, TextSearchBox1.Text),
    Status.Value = ExpensesStatus
    ),
    "Title",
    If(SortDescending1, Descending, Ascending)
    ) )

    More details about Filter function in PowerApps, please check the following article:

    Filter function

     

    In addition, if you want to remove the Status filter condition from your Gallery, you could consider take a try to add the following formula within the OnSelect property of the "Refresh" icon button to following:

    Set(ExpensesStatus, Blank())

    when you click "Refresh" icon button, all available records would show up within your Gallery again.

     

    Best regards,

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard