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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (3,418)