Skip to main content

Notifications

Community site session details

Community site session details

Session Id : l3Doxb02s/HRdLUhI0QnMk
Power Apps - Building Power Apps
Answered

Using a combo box to search Office365 users

Like (0) ShareShare
ReportReport
Posted on 28 Jan 2020 13:25:07 by 37

Hi all,

 

I'm trying to use a combo box so that users can search for other staff in my organisation, and select their name.

 

I have set the DisplayFields and SearchFields property to ["DiaplyName"] each.

 

Now if I associate the Items field with the text of a text box, it works exactly as intended. My search in the text gradually limits the items until one remains, searching all users.

 

Items = Office365Users.SearchUser({searchTerm: text_title.Text})

 

But this relies on a separate text box, I want to be able to do this with the Combo Box's own search box.

However, this only searches through a limited list retruend from Office365Users. It seems the combo box Items auto populates with a limited number of users, using a textbox search, searches through all users in the orga, using the combo box's own search, it looks only through the initial limited selection.

 

There's a couple of threads on this already, but they are all from 2018, and below says that this will be resolved by April 2018. But despite this I still can't solve the issue.

 

https://powerusers.microsoft.com/t5/Building-Power-Apps/People-Picker-filter/td-p/102675

 

Can someone advise if a solution is now available? It's very unprofessional to have 2 boxes, with 2 search fields when only one works and updates the items on another.

Categories:
  • KevO Profile Picture
    4 on 11 Apr 2024 at 00:43:13
    Re: Using a combo box to search Office365 users

    I am able to search my entire address book but when I select the search user it immediately goes away. If I select one of the users that shows by default it stays. Any idea why the searched users disappears?

  • _severynm Profile Picture
    66 on 06 Nov 2023 at 14:05:30
    Re: Using a combo box to search Office365 users

    Make use of the second top: argument in the SearchUser function. I also think the O365Users are already sorted alphabetically, but if you wanted to sort by a different field, then use:

    Sort(Office365Users.SearchUser({searchTerm:Self.SearchText, top:10}), DisplayName, SortOrder.Ascending)

    where DisplayName is the field you want to sort against. 

  • JamesHeitmeyer Profile Picture
    16 on 05 Oct 2023 at 15:41:38
    Re: Using a combo box to search Office365 users

    This works for me:

    Get user info from dropdown
    Set( 

        var_UserInfo, 

        Office365Users.SearchUser({searchTerm: ComboBox2.Selected.Value}) 

    ); 

     

    In Image control use first UserPrincipalName to get image: 
    Office365Users.UserPhotoV2( First(var_UserInfo).UserPrincipalName  )

  • AnyoMan Profile Picture
    2 on 19 Jun 2023 at 20:48:05
    Re: Using a combo box to search Office365 users

    Hello,

     

    I have question - This is working for me: Office365Users.SearchUser({searchTerm:EEComboBox.SearchText}). DisplayName

    How can I do to add the picture and email of the person? Also, to order it alphabetical and show only top 10?

    Thanks

  • loha Profile Picture
    53 on 21 Feb 2023 at 18:49:20
    Re: Using a combo box to search Office365 users

    This works great, thank you. I would like to view only users who belong to a certain user group, I have the object ID of the group and was wondering if this could be done in the combobox search? 

     

    I have got it working by creating a collection and searching the collection but would prefer it done within the app if possible?

     

  • Krishna09 Profile Picture
    234 on 03 Nov 2022 at 12:59:36
    Re: Using a combo box to search Office365 users

    @ewfefwef  I tried the formula you mentioned. but what to use instead of SearchUser. It shows invalid for me

    Even I am facing same problem. I am using Users table from dataverse as datasource. if I use items = Users , i amnot able to see all users so i used below formula for items. then my Isseaerchable is turning false.  So can you guide me to solve this for my datasource.

    my items =With(
    {
    data1: Filter(
    Users,
    StartsWith(
    'Full Name',
    ComboBox5.SearchText
    )
    )
    },
    Sort(
    Distinct(
    data1,
    'Full Name'
    ),
    Result
    )
    )

  • NBMS_2019 Profile Picture
    59 on 17 Jun 2022 at 14:12:40
    Re: Using a combo box to search Office365 users

    I have a SharePoint List Lookup field being customized in Power Apps. This is not valid for me "Office365Users." as part of the formula for SearchFields property.

     

  • Community Power Platform Member Profile Picture
    on 01 Jun 2022 at 09:02:38
    Re: Using a combo box to search Office365 users

    The solution is working but there are too many in the result. I got all the name of employee in my company plus outsorces who are now working in my company.

     

    Is there a way to filter the result further to list only some departments or some specific email domainnames?

  • dibb Profile Picture
    34 on 29 Dec 2021 at 01:45:05
    Re: Using a combo box to search Office365 users

    perfect, thanks man

  • ewfefwef Profile Picture
    57 on 15 Apr 2021 at 05:42:26
    Re: Using a combo box to search Office365 users

    Combo box solution.

    If(!IsBlank(Trim(Combo.SearchText)), Sort(Filter(Office365Users.SearchUser({searchTerm: Trim(Combo.SearchText), top: 15}),AccountEnabled),DisplayName,Descending))

    Properties 

    ewfefwef_0-1618465326023.png

     

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!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard