cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Creechyy
Frequent Visitor

Patching ComboBox Items to Multi-Select People Picker Column in SharePoint

Hello All,

 

I am working on making a submission screen so that our Project Managers can record the participants of their weekly toolbox talks.

 

I have tried several formulas to try and patch the selected items (users) to my SharePoint list, but have been unable to successfully. I have only been able to patch the first selected user or, in some cases, none at all. 

 

This is my current placeholder formula until I can find the right one:

 

Patch('Toolbox Talks Submissions',
Defaults('Toolbox Talks Submissions'),
{
Toolbox_x0020_Talk:{
Id: Gallery10.Selected.ID,
Value: Gallery10.Selected.TalkTitle
},
Participants: Gallery7_2.AllItems,
Usefulness: {Value: Radio1_21.Selected.Value}
}
)

 

I have also tried this formula to patch the participants:

 

ForAll(ComboBox1_1.SelectedItems,
{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & Mail,
Department:"",
DisplayName: DisplayName,
Email: Mail,
JobTitle:"",
Picture:""
})

 

This also did not work.

 

Is there a way to patch multiple selected people to a multi-select people picker column in SharePoint?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Creechyy 

I would consider changing the Items property to:

    Filter(Office365Users.SearchUserV2({searchTerm:"",top:35}).value, Department="Job Site")

As the SearchUser action has been deprecated.

 

For your Patch formula, it should be the following:

Patch('Toolbox Talks Submissions',
    Defaults('Toolbox Talks Submissions'),
    {
      Toolbox_x0020_Talk: {Id: Gallery10.Selected.ID, Value: Gallery10.Selected.TalkTitle},
      Participants: 
           ForAll(ComboBox1_1.SelectedItems,
               {Claims:"i:0#.f|membership|" & Lower(Mail),
                Department:"",
                DisplayName: DisplayName,
                Email: Mail,
                JobTitle:"",
                Picture:""
               }
           ),
      Usefulness: {Value: Radio1_21.Selected.Value
    }
)

Assuming that Toolbox Talk is a Lookup column and Usefulness is a Choice column and, of course, that your Participants column is a multi-select person column.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@Creechyy 

First, what is the Items property of Combobox1_1 ?

Next, in one formula you are trying to patch the column with AllItems from a Gallery - is that intentional?  I am not sure where your Gallery fits into this.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

The Items property of ComboBox1_1 is this:

 

Filter(Office365Users.SearchUser({searchTerm:"",top:35}),Department="Job Site")

 

And yes the Gallery is there to display the people that have been selected. In that formula, I placed it there as a holder. 

This is what the screen currently looks like:

 

InkedInkedInkedscreenshot-us.create.powerapps.com-2021.06.14-10_38_25_LI.jpg

RandyHayes
Super User
Super User

@Creechyy 

I would consider changing the Items property to:

    Filter(Office365Users.SearchUserV2({searchTerm:"",top:35}).value, Department="Job Site")

As the SearchUser action has been deprecated.

 

For your Patch formula, it should be the following:

Patch('Toolbox Talks Submissions',
    Defaults('Toolbox Talks Submissions'),
    {
      Toolbox_x0020_Talk: {Id: Gallery10.Selected.ID, Value: Gallery10.Selected.TalkTitle},
      Participants: 
           ForAll(ComboBox1_1.SelectedItems,
               {Claims:"i:0#.f|membership|" & Lower(Mail),
                Department:"",
                DisplayName: DisplayName,
                Email: Mail,
                JobTitle:"",
                Picture:""
               }
           ),
      Usefulness: {Value: Radio1_21.Selected.Value
    }
)

Assuming that Toolbox Talk is a Lookup column and Usefulness is a Choice column and, of course, that your Participants column is a multi-select person column.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Creechyy
Frequent Visitor

I just got an error message:

Screenshot (3).png

 

The record also did not patch to SharePoint whatsoever.

 

I have seen other users that have patched from a temporary collection. I have not used collections that much, but would this be a better solution?

RandyHayes
Super User
Super User

@Creechyy 

No, a collection is of no use in this case, you already have the information you need in your controls, there is no sense in duplicating it again.

Your issue in that formula is with the user from your combobox.  It is telling you that the user does not exist in SharePoint.

Can you narrow down to a particular selected user?  If you select only one user in the combobox and then submit, if you get the error, can you look in the user profiles of your SharePoint admin to see if there is in fact that user or not?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

It works and you were right! I had a few users added to the admin center that had yet to fully log into their account. It works with those who have. Great solution!! Thank you for all your help.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,099)