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 / Sharepoint custom form...
Power Apps
Answered

Sharepoint custom form: Person field (multiple select) combobox with Office365 group data source - DefaultSelectedItems?

(0) ShareShare
ReportReport
Posted on by 14

Hello, 

I need help to figure out the DefaultSelectedItems property for combobox for person field (multiple select) in Sharepoint. 

 

Here is the situation. 

I started custom sharepoint form, I inserted a new combobox in datacard which connects to person field in Sharepoint. The field is set to multiple. 

I figured out what to write on "items" for combobox and "update" on datacard. They are set as below.

 

items: 

Office365Groups.ListGroupMembers("groupID888888888888888").value
 
Update: 
If(!IsBlank(ComboBox1.SelectedItems),

ForAll(ComboBox1.SelectedItems As aSel,
{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & aSel.mail,    
DisplayName: aSel.displayName,    
Email: aSel.mail,    
JobTitle: "",    
Picture: ""  
}),
Blank())
 
It is working for new entry. It updates person column in sharepoint.
HOWEVER... when I try to edit existing item, combobox is not showing stored items (people). 
 
I think I need to write something on "defaultselecteditems" property on combobox but I can't figure out. 
Can anyone help?
 
Thank you!

 

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @MasaYR - this is my method, see if you can leverage this for your needs.

     

    1. In the Items property of the ComboBox control inside the DataCard, I would use:

     

    Office365Groups.ListGroupMembers(
     "groupID888888888888888",
     {'$top': 999}
    ).value
    

     

    2. In the Update property, use:

     

    ForAll(
     ComboBox1.SelectedItems As _selections,
     {
     DisplayName: _selections.displayName,
     Claims: "i:0#.f|membership|" & Lower(_selections.mail),
     Department: "",
     Email: _selections.mail,
     JobTitle: "",
     Picture: ""
     }
    )
    

     

    3. In the DefaultSelectedItems property, enter:

     

    If(
     !IsBlank(ThisItem.'Your Multi Choice People Field'),
     ForAll(
     ThisItem.'Your Multi Choice People Field' As _selections,
     First(
     Filter(
     Office365Groups.ListGroupMembers(
     "groupID888888888888888",
     {'$top': 999}
     ).value,
     mail = _selections.Email
     )
     )
     )
    )

     

    Do not make any other modifications to the DataCard.

     

    Note

     

    I find the performance of using SharePoint user groups as poor when applying them into the Items property of ComboBoxes. You can literally see the loading dots appearing at the top of the screen while the Combobox is loading in the selected items.

     

    See a blog I wrote below for a faster alternative. Note this solution is specific to single choice people fields, but the same concept can be applied to multi-choice people fields:

     

    https://powerusers.microsoft.com/t5/Power-Apps-Community-Blog/Filter-SharePoint-single-select-People-Picker-based-on-another/ba-p/2235959

  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    Hi @MasaYR 

     

    Can you tweak ForAll code to:

    If(
     !IsBlank(ComboBox1.SelectedItems),
     ForAll(
     ComboBox1.SelectedItems As aSel,
     {
     Claims: "i:0#.f|membership|" & aSel.mail,
     Department: aSel.department,
     DisplayName: aSel.displayName,
     Email: aSel.mail, 
     JobTitle: "", 
     Picture: "" 
     }
     ),
     Blank()
    )

     

    Then because I think you're using the Office 365 Groups connector to drive the combo box.
    Try this (might need a tweak, not sure yet) in the DefaultSelectedItems property of the combo box:

    ForAll(
     Parent.Default,
     {
     displayName: DisplayName,
     givenName: "",
     id: "",
     jobTitle: JobTitle,
     mail: Email,
     userPrincipalName: Email
     }
    )

     

  • MasaYR Profile Picture
    14 on at

    @Amik 
    Thank you so so so much! It works! I have been looking for the answer to this for few days. 

    So happy! Thank you again!!

  • MasaYR Profile Picture
    14 on at

    @Amik, @DJ_Jamba 
    Hi again... 

    I have encountered new issue. 

    Solution above worked very well but now I am realizing that my sharepoint list has some items contain old employee who left company. Hence: he is not in this Office 365 Group member. 

    When I hit edit button on that item, person column does not show anything (of course, I guess because he is not in that group...).

    If there are multiple names, it does not even show the other person (who is in the group). 
    I am assuming I have to write "If" sentence in both "Update" and "DefaultSelectedItems"??

     

    How do I solve this issue? I would not want him to appear in the new item creation but on edit, I want his name to show up in that multi person combobox. 

     

    Thank you in advance for your help!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard