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 / 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

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    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

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