cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dennisb88
Responsive Resident
Responsive Resident

filter office365users max number of results

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,

1 ACCEPTED SOLUTION

Accepted Solutions

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

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

4 REPLIES 4
iAm_ManCat
Super User
Super User

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)

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


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?

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

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


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)

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,146)