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. []
Solved! Go to Solution.
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...
first I split the email address input from semicolon split(triggerBody()['email'],';')
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.
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:
edit: I feel that the issue is in the ""
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...
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |
User | Count |
---|---|
49 | |
29 | |
24 | |
24 | |
20 |