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 / Office365Users.SearchU...
Power Apps
Unanswered

Office365Users.SearchUser() Search by location/department/jobtitle

(0) ShareShare
ReportReport
Posted on by 87

if I use  Office365Users.SearchUser({searchTerm:TextInput1.Text,top:500}) , it will only search by user name. Is there a way to search all other fields as well.

e.g. If type in Marketing in the textinput field, the gallery will return everyone from marketing department.

Categories:
  • v-monli-msft Profile Picture
    Microsoft Employee on at

    Hi @agent3154,

     

    According to https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-office365-users:

    SearchUser

    Search for users: Retrieves search results of user profiles

    Input properties

    Name Data Type Required Description
    searchTerm string no Search string. Applies to: display name, given name, surname, mail, mail nickname, and user principal name

    Output properties

    Property Name Type Description
    Department string Department of the user.
    DisplayName string Display name of user.
    GivenName string Given name of user.
    Id string User id
    JobTitle string Job Title of the user.
    Mail string Email id of user.
    MailNickname string Nickname of user.
    Surname string Surname of user.
    TelephoneNumber string Telephone number of user.
    UserPrincipalName string User Principal Name.
    AccountEnabled boolean Account enabled flag.

     

    But in my App, I had a connection to Office 365 Users, and I inserted a Text box and set its Text property to show information about current user, for example: Office365Users.MyProfile().DisplayName, it worked well and user DisplayName was shown. When I set its Text property to show user Department, I got the same issue with you, no error message and no user Department information was shown. And I also tried to show information about another user, I can also get information about DisplayName, ID, etc. but I can’t get Department information.

     

    It is a limitation of the connector. The Microsoft Graph API supports filtering on department, but it is not exposed by the connector. We are currently working on a fix. 

     

    Regards,

    Mona

  • Aaronk21234 Profile Picture
    26 on at

    I'm looking for a similar solution.  I'm looking to generate gallaries of all employees of a specific JobTitle, Department, or Location.

  • Karl G. Schneider Profile Picture
    54 on at

    In this Casse the Office365Users.SearchUser() Connector is not reliable in Tenants with more then 999 Users, because the filter on JobTitle, Department or Location is established after the top:999 User Limit. No Pagination in Batches possible with this Connector. So the filters on JobTitle, Department or Location are not delegable. Suboptimal Connector Design.... 

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
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard