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 / Employee Directory Fil...
Power Apps
Answered

Employee Directory Filtering

(0) ShareShare
ReportReport
Posted on by 8

Hello

I'm looking to build a staff directory using Powerapps. I have got as far as creating a working directory by following this guide https://blog.pragmaticworks.com/create-an-employee-directory-in-powerapps The trouble is that it is including all of the shared mailboxes when I only want it to display the current employees. I thought I could get around this by adding a filter to only display results where a line manager has been assigned. I'm not quite sure how to edit my formula to exclude results where the line manager for a record is blank. This is what I have so far:

 

Filter(Office365Users.SearchUser({searchTerm:TextInput1.Text}),CompanyName="mycompany1",AccountEnabled=true)

 

I also want to include multiple company names but if I change the formula to look for CompanyName="mycompany1" or CompanyName="mycompany2" it doesn't like it. I have tried using OR and IF statements but I'm not quite sure how to do it so any suggestions would be much appreciated.

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,539 Super User 2026 Season 1 on at

    Filter(Office365Users.SearchUser({searchTerm:TextInput1.Text}),CompanyName=

     

    OR("mycompany1","mycompany2","mycompany3")   //allows to add multiple company names

     

    ,AccountEnabled=true,

     

    ,Manager != "" //not sure if this works, but would add an extra criterium to make sure the this account has a manager

    )

  • mariesk Profile Picture
    8 on at

    Thank you. I tried just adding the extra company names first with your code and I got the error 'Incompatible types for comparison. These types can't be compared:Text, Error'. I'm not sure why it thinks this as it works with the company names separately, just not together.

  • Verified answer
    BCBuizer Profile Picture
    22,539 Super User 2026 Season 1 on at

    Perhaps:

     

    CompanyName= "MyCompany1" || CompanyName= "MyCompany2" || ....

     

     

  • mariesk Profile Picture
    8 on at

    Thank you, that worked perfectly. I wasn't able to get it to filter out the records with no manager assigned so I filtered out the records without a job title instead which I managed to do with this code

     

    Filter(Office365Users.SearchUser({searchTerm:TextInput1.Text}),CompanyName="mycompany1" || CompanyName="mycompany2" || CompanyName="mycompany3",AccountEnabled=true,!IsBlank(jobtitle))

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 70

#2
WarrenBelz Profile Picture

WarrenBelz 64 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 36 Super User 2026 Season 1

Last 30 days Overall leaderboard