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

filter office365users max number of results

(0) ShareShare
ReportReport
Posted on by 603

Hi all,

 

I'm trying to create a collection of all users that are stored in the Azure AD. 

 

Because the organisation have more than 999 users in Azure AD, I'm try to a filter on domainname. (With this result I expect 270 users)

 

But load this collection, It looks like that I'm hit some boundaries because I've 105 results in my collection, and it stops with accounts that are starts with the letter L. So it's look like I'm still having an issue with some limits.

 

This is my filter to get my collection:

 

ClearCollect(Col_Users,Filter('Office365Users'.SearchUserV2().value , var_Usermaildomain in UserPrincipalName))

 

Does anyone know what I can to do to get all the expected results?

 

Kind regards,

Categories:
  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Yes, the default top count for SearchUsers is 1000, so you'll need to make that larger, also you have no searchterm in searchUser, so its returning all users, but again hitting that limit:

     

    ClearCollect(Col_Users,Filter('Office365Users'.SearchUserV2({searchTerm:var_Usermaildomain ,top:2000}).value , var_Usermaildomain in UserPrincipalName))

     

    https://docs.microsoft.com/en-us/connectors/office365users/#search-for-users-(v2)

  • dennisb88 Profile Picture
    603 on at

    Hi @iAm_ManCat ,

     

    Thank you for your reply.

    I just try your formula but that give me only 0 results back. Where I expect more.

    For your information I'm also try to extract the variable to show you the input I've in my variable:

     

     

     

    ClearCollect(Col_Users,Filter('Office365Users'.SearchUserV2({searchTerm:"contoso.com",top:2000}).value , "contoso.com" in UserPrincipalName))

     

     

     

    When I change the formula to this value I get 117 results, but it's still stops by the users where the name starts with the letter L:

     

    ClearCollect(Col_Users,Filter('Office365Users'.SearchUserV2({searchTerm:"" ,top:2000}).value , "@contoso.com" in Mail))

     

     

    Do you've any idea how to achieve all the results in this case?

  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    yes, you must have a search term, with no search term, it is getting the first thousand results, then inside of those it looks for @hatever you are filtering by, so before you even start filtering, you already only have the first thousand results, which is why it stops at L

  • dennisb88 Profile Picture
    603 on at

    Hi @iAm_ManCat ,

     

    Thanks I fix it in my combobox to search for the right user. Now I got all the results I need.

    Filter('Office365Users'.SearchUserV2({searchTerm:combobox1.SearchText ,top:2000}).value , "@contoso.com" in Mail)

     

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 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard