cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mkhan73
Helper I
Helper I

How to Patch multiple User Email to Person/Group column which allows multiple values?

I am trying to patch multiple combo box (User email) values to person/group column which allows multiple values. But, PowerApps is only patching the last selected person value. Anyone know how to achieve this task? 

 

Below is my code, I am also collecting User email in collection. If I try to do SelectedItems.Email, PowerApps give me the error. 

 

ForAll(ApproversCollection.ApproverName,
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: ComboBox2.Selected.Email,
Department: "",
DisplayName: DisplayName,
Email: Email,
JobTitle: "",
Picture: ""
}
)

1 ACCEPTED SOLUTION

Accepted Solutions

I got it working through this and without collection

 

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

)

View solution in original post

5 REPLIES 5
RandyHayes
Super User
Super User

@mkhan73 

Please consider changing your Formula to the following:

ForAll(ApproversCollection,
    {
    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    Claims: ApproverName.Email,
    Department: "",
    DisplayName: ApproverName.Email,
    Email: ApproverName.Email,
    JobTitle: "",
    Picture: ""
    }
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
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!

@RandyHayes I tried this but I am getting the following error:

 

mkhan73_0-1603302743387.png

 

@mkhan73 

Sorry, I had copied your original and didn't notice the mistake. 

Your formula should be the following:

 

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

 

EDIT: Actually I am also noticing that you were using ApproverName before in your ForAll...is the Email column in the Approver name a single line of text (email) or is it a table of emails?

 

_____________________________________________________________________________________
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!

@RandyHayes Now I am getting this error,

 

mkhan73_0-1603305231055.png

 

Here is my collection with four records and I am always getting the last record instead of all four records

 

 

mkhan73_2-1603305347439.png

 

 

 

I got it working through this and without collection

 

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

)

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,652)