web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to Split Email add...
Power Apps
Answered

How to Split Email address and save data in a Person column of SharePoint List

(0) ShareShare
ReportReport
Posted on by 106

I have a collection named "SelectedParticipants" which has only 1 column named "Email". Lets say it contains below values:

Email
abc@xyz.com;def@xyz.com;asd@xyz.com;
abc@xyz.com;
abc@xyz.com;def@xyz.com;

 

I have a SharePoint list Named "PersonList" which have a Person Type column named "Participants" and allow multiple selection

I want to save data to this Participant column base on Email addresses of the "SelectedParticipants" collection

I am using below code 

 

ForAll(SelectedParticipants,Patch(PersonList, Defaults(PersonList),{Title:"test",Participants:If(!(IsEmpty(Email)),ForAll(Split(Email,";"),{DisplayName: Office365Users.UserProfile(Text(Trim(Result))).DisplayName, 
 Claims: "i:0#.f|membership|" & Lower(Office365Users.UserProfile(Text(Trim(Result))).Mail),
 Department: "",
 Email: Office365Users.UserProfile(Text(Trim(Result))).Mail,
 JobTitle: "",
 Picture: ""}))}

 

but I am getting below error "The requested operation is invalid. Server Response: PersonList failed: The specified user i:0#.f|membership| could not be found."

But if I use any hardcoded value like "abc@xyz.com" in Office365Users.UserProfile() function then data is saving in the Person Type column.

 

Can you please help what's the wrong I am doing.

 

Urgent help needed.

 

Thanks!

 

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @hkmamun 

    This error maybe caused by the trailing semicolon in your collection data? When you use Split() I think you are creating a blank Email which Office365Users.UserProfile cannot find, hence the error.

     

    Try removing the trailing ';' from your collection before running your code. You could use a ForAll or AddColumns with Left(columnName, Len(columnName)-1). I haven't tested this but it should work.

     

    The other part you maybe missing is the odata.type ... Shane's Young demos it in this video

    at the 18min mark.

  • KrishnaV Profile Picture
    5,023 on at

    Hi @hkmamun ,

     

    You need to use the below code block to save the people picker value:

    Set(requesterClaim,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims:"i:0#.f|membership|" & User().Email,
     Department:"",
     DisplayName:User().FullName,
     Email:User().Email,
     JobTitle:"",
     Picture:""
     });

     
    If you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • KrishnaV Profile Picture
    5,023 on at

    Hi @hkmamun ,

     

    Change your code block as below:

     

    ForAll(SelectedParticipants,Patch(PersonList, Defaults(PersonList),{Title:"test",Participants:If(!(IsEmpty(Email)),ForAll(Split(Email,";"),{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",DisplayName: Office365Users.UserProfile(Text(Trim(Result))).DisplayName, 
     Claims: "i:0#.f|membership|" & Lower(Office365Users.UserProfile(Text(Trim(Result))).Mail),
     Department: "",
     Email: Office365Users.UserProfile(Text(Trim(Result))).Mail,
     JobTitle: "",
     Picture: ""}))}

     

     

    All you missed is:

    '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser"


    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • hkmamun Profile Picture
    106 on at

    @KrishnaV  thanks for your help, but missing "'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser"" is not a problem. Actual problem is what @Anonymous says. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard