Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Office 365 Users Search Users V2 very large Dataset (more than 1'000'000 entries) (retrieve and filter)

Dear Power Apps Community,


[Power Automate / Flow]

I've got a big issue. I would like to get all the users from a department, aswell as all the users from the departments below the root department.

Since "Search Users V2" cannot search for department, I need all the users and the filter the results.

The issue is just that my company is very large (~1000k users) and I get from "Search Users V2" (pagination activated, 100k per page), 100899 users back. Now, what irritates me, is the very weird number... not 100k as I would have expected, but slightly more. Any ideas, what might be the issue here?


Also, "Search Users V2" does not allow querying, so I have to somehow process the huge response. "Apply each" does ofc not work, due to the 10k limit. I read on this forum that a filter array might be the solution but that does not even accept the dataset as input (I guess too large) Error message

The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@contains(item()?['Department'], 'CR/')' failed: 'The template language function 'contains' expects its first argument 'collection' to be a dictionary (object), an array or a string. The provided value is of type 'Null'.'.

The input is the very large JSON-object/"value" of "Search Users V2".



I am at my wit's end... Thank you in advance already for your efforts and support!

Frequent Visitor


It seems like I accidentally posted this question in the wrong topic, I think it should be better in "Building Power Apps"... Sorry 😞

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

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

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (5,980)