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
Resident Rockstar
Resident Rockstar

@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...

 

 

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA 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

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (40,266)