cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Creechyy
Regular 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 III
Super User III

@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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

7 REPLIES 7
RandyHayes
Super User III
Super User III

@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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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 III
Super User III

@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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

Creechyy
Regular 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 III
Super User III

@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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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 User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,388)