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 / Filter breaking galler...
Power Apps
Unanswered

Filter breaking gallery's labels display function

(0) ShareShare
ReportReport
Posted on by 16

I have this code for a gallery where I want to find people from a specific department only:

Filter(Office365Users.SearchUser({searchTerm: "", top: 999}), Department = "departmentName")
 
"departmentName" is only a replacement for the real department name, for security purposes.
 
When I use:
Filter(Office365Users.SearchUser({searchTerm: "", top: 999}), Department)
 
it works, but shows everyone, because there's no department filter.
 
But, when I use:
Filter(Office365Users.SearchUser({searchTerm: "", top: 999}), Department = "departmentName")
 
it gives me no errors, although it stops display information on the gallery's labels.
 
Does anyone have any idea on why does this happen?
Categories:
  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @JoaoCorreia,

     

    Are you sure the Department column is 1. populated and 2. you have exactly matched, including capitals, an existing department?

  • JoaoCorreia Profile Picture
    16 on at

    Yes, I am sure. I tried using 1 different Department Name and it worked. The one I want to use has "-" separating some characters, and the other one I tried is only 1 word. Maybe that's the problem. How can I solve that?

     

  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @JoaoCorreia ,

     

    When doing a short test, I didn't see any issues: 

    BCBuizer_0-1716996975602.png

     

    The hint you dropped about the "-" in the department name only sparks an idea to make sure you have included the exact amount of spaces before and after the "-".

  • JoaoCorreia Profile Picture
    16 on at

    I just checked and it actually finds the department, but it does extract the information to the labels

     

  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @JoaoCorreia ,

     

    Can you please share how the information is supposed to be extracted to the labels?

  • JoaoCorreia Profile Picture
    16 on at

    I made a simple test on this and discovered something: when I use:

     

    Filter(
        Office365Users.SearchUser(
            {
                searchTerm: UserSearchbarSingle.Text,
                top: 30
            }
        ),
        Department = "departmentName"
    )
     
    it shows nothing, but if I search the name of any element of the team it works and shows it. Also, I know it is filtering because when I search for the surname of 1 element that I know that his surname is the same of some other people outside the team, it only shows the one inside the team. So, the filter works, and it extracts information. The only problem is that I want to display all the members of the team BEFORE searching and it is not working. Also, it does not search properly, for instance:
     
    my name is Joao Correia. It is represented as CORREIA Joao. If I search "J" or "C" for example, it returns nothing. I just don't understand how the search system really works in this situation so I can't see a solution. I hope this helps you understand the problem better.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard