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.SearchUsers returns empty

(0) ShareShare
ReportReport
Posted on by 195

Hi,

 

Filter(Office365Users.SearchUser({searchTerm:"."}),JobTitle in "Sales"||Department in DataCardValue4.Text).DisplayName always returns empty. Any inputs would be helpful. Thanks.

 

 

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Kumar9024021 ,

    Could you please share a bit more about your scenario?

     

    Based on the formula you provided, I think there is something wrong with it. On your side, please consider modify your formula as below:

    Filter(
     Office365Users.SearchUser({searchTerm:""}), // do not type '.' as search value for the searchTerm property
     "Sales" in JobTitle || DataCardValue4.Text in Department
    ).DisplayName

    or

    Filter(
     Office365Users.SearchUser(),
     "Sales" in JobTitle || DataCardValue4.Text in Department
    ).DisplayName

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • Kumar9024021 Profile Picture
    195 on at

    Hi @v-xida-msft,

     

    As requested, I tried the below formula. If I remove the Department portion from the query, it returns results but only around 8 users (all starting in alphabet A). I do have 100+ users whose Job Title is Sales from my 2500 user profiles.

     

    Also, If i combine department, my query always returns empty. I am assuming that it doesn't results for 2500 profiles and checks only 999 profiles.

     

    Filter(
     Office365Users.SearchUser({searchTerm:""}), // do not type '.' as search value for the searchTerm property
     "Sales" in JobTitle || DataCardValue4.Text in Department
    ).DisplayName

     

     

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Kumar9024021 ,

    Yeah, you are right. Currently, there is an known limits with the Office365Users.SearchUser(...) function -- it could only retrieve 999 records from your Office 365 Users service at most once time.

     

    On your side, please modify your formula as below:

    Filter(
     Office365Users.SearchUser({searchTerm:"", top: 999}), // specify top property to 999, so you could retrieve 999 records at most once time
     "Sales" in JobTitle || DataCardValue4.Text in Department
    ).DisplayName

     

    If you want to retrieve all user profiles (e.g. 2500) through the Office365Users.SearchUser(...) function, I afraid that there is no way to achieve your needs in PowerApps currently.

     

    If you want to get rid of this known limit with Office 365 Users connector, as an alternative solution, you could consider create a custom connector within your PowerApps based on Microsoft Graph REST API, within the custom connector, define corresponding action to retrieve user profiles from your tanent, after that, add the custom connector connection into your app to retrieve user profiles from your tenant.

    More details about creating a custom connector based on MS Graph REST API, please check the following blog:

    https://gotoguy.blog/2017/12/17/access-microsoft-graph-api-using-custom-connector-in-powerapps-and-flows/

    More details about the customizing custom connector in PowerApps, please check the following article or video:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/register-custom-api

    https://www.youtube.com/watch?v=dBCS1nPsDiE

     

    Best regards,

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

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard