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 / Forcing a People Picke...
Power Apps
Answered

Forcing a People Picker to not search users across Organization but just an Office group

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All,

This control below searches users across the organization. It's a SP integrated form and we have a People Data Type in the list.

GauravG_0-1620243287191.png

Is there a way for this combo-box to search only in 1 office group.

I have a group already which i am using for field visibility in the Power App on OnStart property of App, as shown below.

Please suggest

GauravG_1-1620243466467.png

@RandyHayes Hey Randy, tagging you since you are live!

Categories:
  • Verified answer
    zaphod88 Profile Picture
    502 on at

    Set the Items property to
    'Office365-Groups'.ListGroupMembers("GroupID").value.mail
    or create a Collection of the group members to show it in the combobox.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @zaphod88 Thanks

    The issue i see is that it just shows email now. (No image, no name)

    GauravG_1-1620244573212.png

    Can it not show as it does when it searches cross the organization- wherein it has images as well.

    GauravG_2-1620244733897.png

     

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Still live but way behind on responses....

     

    You will not be able to easily get what you are looking for with the Combobox.  It will only display images for records coming from the SharePoint person column choices (this is because that record includes a picture - ListGroupMembers will not).

    You could try to induct in pictures in to the items record, but the combobox will not recognize it properly because it would need to be converted to another format that it is expecting.

     

    So, you really need to either just use the Person column or forget about the pictures, or create some other conglomerate of gallery and searching to do it (not a trivial task).

     

    I hope this is helpful for you.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I'll stay with Display Name field instead of Mail- that helps me.
    I'll forget about the images- because we want search to be looking only at our team folks. Thanks

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Very good, then set the Items property to:

    Office365Groups.ListGroupMembers("yourGroupID").value

    Then go to Edit field and change to the style you want.  You can have single layout or double.  Single if you just want displayname, double if you want something else.  Then set the Primary Text to displayName and the SearchField to displayName if you are allowing searching.  If setting to double layout, then set the Secondary text to whatever else you want.

    RandyHayes_0-1620257537569.png

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes The the value in this column is not getting saved, and i am able to save the form without seeing any error. The items property is as shown below

    GauravG_0-1620821390301.png

    And the Update Property of the control is DataCardValue18_3.Selected

    In my SP list, the properties are as shown below:

    GauravG_1-1620821876111.png

    I thought that since the Choose From is set to be coming from ALL USERS, it may be interfering with saving the Power App field value since we are searching from an AD group in the app in SP list (as shown above).

    The weird thing is that i can't change the data type from Person/ Group to Single Line of Text or any other data type.

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Yes, Office365 Users are a different record schema than a SharePoint user.

    You will run into issues with the Items property you have as you are restricting the column results to be only displayName.  This will exclude all of the information you will need.

    So, change your Items property to:

    Sort(
     Office365Groups.ListGroupMemebers(xxxxxxxxxxxxx).value,
     displayName
    )

    This will retain the entire record information for the 365 User.

     

    Then change your Update property to:

    { 
     Claims:"i:0#.f|membership|" & Lower(DataCardValue18_3.Selected.email), 
     Department: "", 
     DisplayName: DataCardValue18_3.Selected.displayName, 
     Email: DataCardValue18_3.Selected.email, 
     JobTitle: ".", 
     Picture: "."
    }
    
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Vow! No words- it worked.

    The only change i had to make was to replace email with mail in the Update property.

    Can you share a brief or link on info on what you did with the Update property? Haven't ever seen this Claims thing before.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Glad it helped out!!

    Yes I can never remember which ones are email, Email, and mail.  Surprisingly enough, I understand why they made them all different.

     

    I am not sure about any particular information on the user record - although I am sure there are plenty of articles about the SharePoint user record.  That is what it is.  The SharePoint user management system uses a Claims column to identify users.  Not to mention other column types.

    So, in the formula, we just converted the Office365 user record from the selection in the combobox to a record that is compatible with a SharePoint user.  

    One of those things that you just have to know about user records, and one of those things that you put into a OneNote somewhere so you can reference it.  After over 3+ years doing it, I still look it up in my OneNote every time.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Also, for your DefaultSelectedItems property on the combobox, you will want to create a matching record.

    There are a couple of ways to go about it, here is one to try in the DefaultSelectedItems:

     

    Filter(
     Office365Groups.ListGroupMembers(xxxxxxx).value,
     mail=ThisItem.yourColumnName.Email
    )

    This will ensure that you have a record that matches the Item property record schema based on the exiting value.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard