cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kumar9024021
Helper V
Helper V

Office365Users.SearchUsers returns empty

Hi,

 

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

 

 

3 REPLIES 3
v-xida-msft
Community Support
Community Support

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,

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.

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

 

 

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-f...

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,

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.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,873)