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

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

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

@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: ""
}

)

View solution in original post

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

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

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