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 filter not wor...
Power Apps
Answered

Gallery filter not working based on combobox Selection

(2) ShareShare
ReportReport
Posted on by 144
I have a Gallery filter which is not working based on combobox selection. If i select the combobox value as My Requests, it should show my own requests. If i select combobox value as Pending my action, it should show requests where i am being assigned as a Manager. 
 
By default, combobox will show MyRequests as preselected. Currently Gallery shows empty if i select any combobox value. May i know where i am going wrong?
 
Gallery Items
With(
    {
        _activerequests: SortByColumns(
            Filter(
                'Users',
                (Len('ETypeCB'.Selected.Value) = 0 || 'Employee Type'.Value = ETypeCB.Selected.Value) && (Len('LocationCB'.Selected.Name) = 0 || Location.Value = LocationCB.Selected.Name) && (Len(SwitchCB.Selected.Value) = 0 || (SwitchCB.Selected.Value = "My Request" && (AdUser.Email = User().Email)) && (SwitchCB.Selected.Value = "Pending my Action" && (Manager.Email = User().Email ))) && (StartsWith(
                    'First Name',
                    SearchBox.Text
                ) || StartsWith(
                    Title,
                    SearchBox.Text
                ))
            ),
            "Modified",
            SortOrder.Descending
        )
    },
    SortByColumns(
        _activerequests,
        varsortcolumn,
        varsortdirection
    )
)
 
ComboBox default selecteditems
{Value:"My Request"}
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,271 Most Valuable Professional on at
    I assume it is SwitchCB that you are referring to here. If that is the case, you need Or || instead of And && where shown below.
    With(
       {
          _activerequests: 
          SortByColumns(
             Filter(
                'Users',
                (
                   Len('ETypeCB'.Selected.Value) = 0 || 
                   'Employee Type'.Value = ETypeCB.Selected.Value
                ) && 
                (
                   Len('LocationCB'.Selected.Name) = 0 || 
                   Location.Value = LocationCB.Selected.Name
                ) && 
                (
                   Len(SwitchCB.Selected.Value) = 0 || 
                   (
                      SwitchCB.Selected.Value = "My Request" && 
                      AdUser.Email = User().Email
                   ) ||
                   (
                      SwitchCB.Selected.Value = "Pending my Action" && 
                      Manager.Email = User().Email 
                   )
                ) && 
                (
                   StartsWith(
                      'First Name',
                      SearchBox.Text
                   ) || 
                   StartsWith(
                      Title,
                      SearchBox.Text
                   )
                )
             ),
             "Modified",
             SortOrder.Descending
          )
       },
       SortByColumns(
          _activerequests,
          varsortcolumn,
          varsortdirection
       )
    )
    You also had a few redundant brackets I have removed.
     
    Please Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  

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 410 Most Valuable Professional

#2
11manish Profile Picture

11manish 159 Super User 2026 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 89 Super User 2026 Season 2

Last 30 days Overall leaderboard