web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Populate a comboBox to...
Power Apps
Unanswered

Populate a comboBox to have the members of a Sharepoint group?

(0) ShareShare
ReportReport
Posted on by 860

So I have a sharepoint List form that has a People/Group column, and I want to limit the number of options it shows, as of now it even shows the CEO of the company lol. Was trying the approach of having only the member below the country manager, was told with this command should go in Items property:

Office365Users.DirectReportsV2(User().Email).value

But that's producing so many errors... So maybe not the path, if you know what I'm doing wrong, do let me know.

Another way I thougth I could go is by limiting to the number of people that are members of the group this List is in. With ChatGPT i found this way:

Office365Groups.GroupMembers(GroupID).value

But also errors T_T So... I'd appreciate if you know how I can accomplish the limiting of the users that appear in the search of the ComboBox, populating it with users from the 365 enviroment.

Categories:
I have the same question (0)
  • johnxt Profile Picture
    on at

    This is how I did it (email domains changed to protect the innocent) pop this in the 'Items' property of your combo box

     

    Filter(Office365Users.SearchUser({searchTerm: Self.SearchText}),AccountEnabled=true && (("microsoft.com" in Mail) || ("microsoft.co.uk" in Mail)) && !("Admin" in DisplayName))

     

     

    If you have lots of people you want to filter out it may not quite be what you need, but you could possibly populate a variable or a sharepoint list perhaps with a list of exclusions.

  • WorkingRicardo Profile Picture
    860 on at

    @johnxt Ty for the reply!

    Altough, I'm a bit confused where do I need to change anything in that code or what goes here: 

    (("microsoft.com" in Mail) || ("microsoft.co.uk" in Mail))
  • johnxt Profile Picture
    on at

    the first thing you would do is change those to whatever domains are valid for your company/list, to filter out any you dont want. The reason I have these set is we also have several '@xxx.onmicrosoft.com' addresses which I don't want to show in my combobox, if your list only has email address domains that you want to show then you can remove that bit of filtering 🙂

  • johnxt Profile Picture
    on at

    so for example you could change it to this:

     

     

    Filter(Office365Users.SearchUser({searchTerm: Self.SearchText}),AccountEnabled=true && (("yourcompany.com" in Mail) || ("yourcompany.co.uk" in Mail) && !(("thebigbossman@yourcompany.com" in Mail) || ("Admin" in DisplayName)))

     

     

     

    so that would only show people with email addresses ending in @yourcompany.com or yourcompany.co.uk, plus hides the Big Boss Man who's email address is thebigbossman@yourcompany.com, and also hides any accounts with 'Admin' in their display name (we have several admin accounts, I don't want to show any of those in my list either)

     

    As I say this may or may not be useful to you, if you have lots of individual people you want to hide it might be better to filter based on a list for example

     

    Edit: Oh and I forgot to say, the {searchTerm: Self.SearchText} bit allows you to start typing a name into the combo box and it'll filter the results in the drop box to people who match if case that wasn't clear

  • WorkingRicardo Profile Picture
    860 on at

    @johnxt ty again.

    Ohh, yeah that option won't work for me. As no matter the country, all accounts end in ".com", no ".uk; .br; .us", etc.

    So yeah, I have a lot o filtering to do. The other option you mentioned is a Sharepoint list? How would you go about that? Because I tried that as well, creating a separate Sharepoint list with a People column called the same as the one in my main one and adding the people I need as individual items, but couldn't get them to populate my Combobox from PowerApps. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard