cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fsim
Helper II
Helper II

convert email address to a sharepoint person

Hi there.

I Built an approval flow on a sharepoint library. the first step of the flow is the "For a selected File" where I get the approvers emails.

I want to save them back into one column of the Library "ApprovedBy". This column is a "person or group" type of column. 

How can I convert the emails I got from the input into one or more person ? The solution below retruns an empty table. []

screen1.jpgscreen2.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
fsim
Helper II
Helper II

Final solution

compose with

split(replace(body('Get_file_properties')?['ContractOwner'],'"',''),';')

 

then a for each with the output of the compose to save the emails in an array variable

append to variable OwnerVar

{
"Claims": "@{items('Apply_to_each')}"
}

and finaly in the update properties I can save the OwnerVar in a Person or group field.

I'm not sure why this double quotes made such troubles...

 

 

View solution in original post

3 REPLIES 3
jinivthakkar
Super User
Super User

@fsim 

 

first I split the email address input from semicolon split(triggerBody()['email'],';')

 

jinivthakkar_0-1614877541771.png

 

 

Click +Add new item and then pass the values:


outputs('Compose')[0] for the Approvedby1 claims & 
outputs('Compose')[1] for other

 

 

 

 
Hope this helps.

--------------------------------------------------------------------------------

If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

fsim
Helper II
Helper II

@jinivthakkar 

sorry for the delay .

I got an error using your solution:

The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Array'. 

but if I look at the source it's a string:

       "email""f...s@sch.com;b...s@sc.com"
but the split don't work 😕

edit: I feel that the issue is in the ""

 

fsim
Helper II
Helper II

Final solution

compose with

split(replace(body('Get_file_properties')?['ContractOwner'],'"',''),';')

 

then a for each with the output of the compose to save the emails in an array variable

append to variable OwnerVar

{
"Claims": "@{items('Apply_to_each')}"
}

and finaly in the update properties I can save the OwnerVar in a Person or group field.

I'm not sure why this double quotes made such troubles...

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,605)