Skip to main content

Notifications

Community site session details

Community site session details

Session Id : /g6EMTh3WcrYDHds8XAb2d
Power Apps - Building Power Apps
Answered

Office365Users Search

Like (0) ShareShare
ReportReport
Posted on 12 Mar 2024 21:59:21 by 260

Hi all,

 

I have a ComboBox that displays office365 users.

I have used the formula's below:

'Items': Office365Users.SearchUser({searchTerm:'cmb_1_Cost Driver'.SearchText})
'DefaultSelectedItems'{Value:Parent.Default}
'DisplayFields'["DisplayName"]
'SearchFields': ["DisplayName"]
 
Its works, but only to a certain point, obviously, because the user list is quite large the scroll function will only show a certain amount, but, when I search for a name, it doesn't come up. It seems to only be showing items in 'A'
 
I must be doing something incorrect here but I am not sure what.
 
Please note I am using a Dataverse table as a DataSource and this ComboBox is in an editable form which has its 'Items' set to 
gl_CPR_Gallery.Selected
Categories:
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on 13 Mar 2024 at 03:26:27
    Re: Office365Users Search

    HI @carrie-anne27,

    Modify your formula to add the top parameter:

    Office365Users.SearchUser({searchTerm:'cmb_1_Cost Driver'.SearchText,top:999})

     

  • Michael E. Gernaey Profile Picture
    41,193 Super User 2025 Season 1 on 12 Mar 2024 at 23:03:03
    Re: Office365Users Search

    Hi @carrie-anne27 

     

    For this 'Items'Office365Users.SearchUser({searchTerm:'cmb_1_Cost Driver'.SearchText})

    How many records are you expecting to find?

     

    But then you say you are using a Table as the DataSource. A DataSource to what, the gallery?

     

    The delegation limit is 500, or 2000 depending on the source and what Settings, you have updated to delegate and/or if the Search is delegatable in general.

     

    So you have a gallery that is listing records. They select that and you said the form items is set to gl_CPR_Gallery.Selected.

     

    How does that Gallery drive the items search you have on the form? Where does this searchTerm come from?

     

    Does it really return back that many records that start with A?

    To me it sounds like you are pulling back too many records and/or possibly not actually filtering properly.

     

    Can you take your code for the ComboBox, put it on a button. Then hardcode the search filter for Office365User connector, with a value that you would have received from the Gallery. See how many records it returns. If its returning thousands I believe you an issue. I truly am not fully sure of what query you would want to find thousands of people for.


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started