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 / Gallery - expression w...
Power Apps
Answered

Gallery - expression with filter

(0) ShareShare
ReportReport
Posted on by 5

I'm using the helpdesk power app from Microsoft. I want to make a simple filter in the gallery, but I can't figure out how the expression should look.

The OOB expression is like this - showing alle tickets if you are administrator and user trimmed if you are an ordinary user:

 

If(isAdmin,Sort(Filter(AllTickets,TaskStatus.Value <> "COMPLETED"),Created,Descending),Sort(Filter(AllTickets,Author.Email = MyProfile.UserPrincipalName || Author.Claims = MyProfile.UserPrincipalName ),Created,Descending))

 

 I want to put a check box in top of the app when ticked only shows tickets from a specific category:

itfrombit_0-1673548840565.png

If I change the expression manually it works fine but how do I make it dynamic with the check box? My expression where I manually filter the category in question:

 

If(isAdmin,Sort(Filter(AllTickets,TaskStatus.Value <> "COMPLETED" && Category.Value = "Rengøring"),Created,Descending),Sort(Filter(AllTickets,Author.Email = MyProfile.UserPrincipalName || Author.Claims = MyProfile.UserPrincipalName ),Created,Descending))

 

My checkbox is labled "KunReng".

itfrombit_1-1673549148243.png

 

Categories:
I have the same question (0)
  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @itfrombit 

    With({_items:If(isAdmin,Sort(Filter(AllTickets,TaskStatus.Value <> "COMPLETED"),Created,Descending),Sort(Filter(AllTickets,Author.Email = MyProfile.UserPrincipalName || Author.Claims = MyProfile.UserPrincipalName ),Created,Descending))},
     Filter(_items, !Checkbox.Value || Category.Value = "Rengøring")
    )
  • itfrombit Profile Picture
    5 on at

    I have been asked to introduce a second filter so there are 2 checkboxes totally, where if none is selected, all items should be shown, and if either of the other 2 is selected it should only show the items respecting the filer and if both are selected it should show items from both categories.

    itfrombit_0-1679225819285.png

    However - if that is not possible, I would then be interested in filtering by a dropdown, where if nothing is selected it should show all categories and the the selected value in the filter should filter based on that. It does not have to be a "multiselect" in this case.

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard