web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details
Power Apps - Building Power Apps
Answered

Writing multiple people from people picker back to SharePoint

Like (0) ShareShare
ReportReport
Posted on 6 Jul 2020 18:56:04 by

I'm new to PowerApps

 

I'm building a form which which populates a sharepoint list with some data. Among other things on my form i have 2 combo box people pickers, one for Owner which allows the selection of 1 person and one for members which allows multiple selections.

 

The Owners combo box has the following in the Items property

 

 

Office365Users.SearchUser({searchTerm:cb_Owner.SearchText})

 

 

While Members has the following

 

 

Office365Users.SearchUser({searchTerm:cb_members.SearchText})

 

 

I have a button which posts the data to sharepoint with the following OnSelect

 

 

Collect(
 MSTSFormList,
 {
 Title: Label1.Text,
 TeamType: DD_TeamType.Selected.'Template id',
 Owner: {
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
 Claims: "i:0#.f|membership|" & Lower(cb_Owner.Selected.Mail)
 },
 Members: Table( {
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
 Claims: "i:0#.f|membership|" & Lower(cb_members.Selected.Mail)
 }
 )
 }
)

 

 

Everything else works works fine however I'm struggling to get members to work. All it does is output the last person that was entered in the the members box, instead of all of them. This does make sense to me as I can see I need to put multiple entries in the table section of the collect, however I'm unsure how to go about this. I've been looking at using ForAll or possibly creating variables that I could put here but I can't figure it out.

 

Any help would be appreciated.

 

Thanks!

 

I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on 07 Jul 2020 at 06:04:06
    Re: Writing multiple people from people picker back to SharePoint

    Hi @Anonymous :

    Do you want to update multiple users to the Member field?

    My method is to use the Forall function:

    Please try this code:

     

    Collect(
     MSTSFormList,
     {
     Title: Label1.Text,
     TeamType: DD_TeamType.Selected.'Template id',
     Owner: {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims: "i:0#.f|membership|" & Lower(cb_Owner.Selected.Mail)
     },
     Members: ForAll(
     cb_members.SelectedItems,
     {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Department: "",
     Claims: "i:0#.f|membership|" & Mail,
     DisplayName: DisplayName,
     Email: Mail,
     JobTitle: "",
     Picture: ""
     })
     }
    )

     

     62.gif

    Best Regards,

    Bof

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete