cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
aaron_scheidler
Level: Powered On

Office365Users Connector - Company Directory

Hi, 

 

I'm making a company directory App and would like to allow the user to see all users assigned to a certain department. My problem is I can only bring in 999 users (Office365Users_2.SearchUser({searchTerm:"", top:999})) but my company may soon surpass this limit. I am trying to find solutions to narrow my returned results down.

 

Ideally I would like to be able to utilize the searchTerm by searching for a Department but I know this is not possible according to the SearchUser documentation. Another option I've thought of is if I could insert a wildcard into the searchTerm and narrow my results by domain (e.g., "@website.com" vs "@website2.com". But I've had no luck with wildcards. I have tried pre-loading the user data into a collection but we are not quite over 999 so I can't test if this works or not.

 

Has anyone been able to successfully bring in over 999 users into their app at once? Either by utilizting collection pre-loading, searchTerm wildcards, or another solution I'm not aware of? 

 

Any help is greatly appreciated. Thanks!

2 REPLIES 2
Community Support Team
Community Support Team

Re: Office365Users Connector - Company Directory

Hi @aaron_scheidler,

Do you want to bring in over 999 users into your app at once using Office365Users.SearchUser() function?

If you want to bring in over 999 users into your app at once using Office365Users.SearchUser() function, I afraid that there is no way to achieve your needs in PowerApps currently.

The 999 is the maximum value of user records retrieved from Office365Users.SearchUser() function at once. The user @JonFrost has faced same issue with you, please check the response from Microsoft Employee @

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
aaron_scheidler
Level: Powered On

Re: Office365Users Connector - Company Directory

Hi _ Kris Dai, 

 

Thank you for your response!

 

I have seen @JonFrost's thread before and have seen the pre-load method described in the blog you referenced. The one issue with pre-loading the way the blog states is, as far as I can tell, there is no unique numeric id field available to bring in using office365Users.SearchUser() function. the Id field that it does bring in is a mix of numeric and character string. 

 

The method that I am currently employing is to:

 

1) grab the first 999 records and store them into a collection, using: (ClearCollect(coll1, SortByColumns(Office365Users_2.SearchUser({searchTerm:"", top:999}), "Id", Ascending)))

 

2) grab the last set of 999 records and store them into a collection, using: ClearCollect(coll2, SortByColumns(Office365Users_2.SearchUser({searchTerm:"", top:999}), "Id", Descending))

 

3) combine the 2 collections together into one single collection (I realize this may double up records but I then group the collection to get rid of any duplicates and get unique values)

 

The thing I am unsure of is if my method of Reversing the sort order actually pulls in the last 999 records or if it pulls in the first 999 records and then reverses that order. I can't test this because we do not have over 999 users yet. As far as I am aware, the SortByColumns is a delegable function but I am unsure if the Office365Users connection is delegable or not. 

 

Would you have any insight if using SortByColumns on Office365Users is actually doing what I think it's doing? 

 

Thanks for your input!

 

-Aaron

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,826)