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 search records ...
Power Apps
Answered

Filter search records by department?

(0) ShareShare
ReportReport
Posted on by 4

Hi,

 

We have 2 Departments in AAD. (Staff/Students).  What´s wrong with my filter/search ? Can´t get this working.

 

If(!IsBlank(Trim(TextSearchBox.Text));Office365Users.SearchUser(
{
searchTerm: Trim(TextSearchBox.Text);
Filter(Office365Users.SearchUser({searchTerm:""}),Department = "Staff");
top: 15
}
)
)

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @ritzadog , try:

     

     

    Filter(Office365Users.SearchUser({searchTerm:Trim(TextSearchBox.Text),top:15}),Department="Staff")

     

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution

    If you like my response, please give it a Thumbs Up.

  • Verified answer
    Ngo-Cong-Tuyen Profile Picture
    91 on at

    Hi, @ritzadog 

    You can change to this:

    Filter(
     If(
     !IsBlank(Trim(TextSearchBox1.Text)),
     Office365Users.SearchUser(
     {
     searchTerm: Trim(TextSearchBox1.Text),
     top: 15
     }
     )
    ),Department= "Staff")

     

  • ritzadog Profile Picture
    4 on at

    Thank you @Ngo-Cong-Tuyen - This worked fine and solved my problem!

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard