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 Automate / Extract email from obj...
Power Automate
Answered

Extract email from object and Append each email to Variable

(0) ShareShare
ReportReport
Posted on by 18

Hi all,

 

I would like to extract each email address from "CopyTo" and append them afterwards.
They are append so I can use them as CC email address later on.

Currently I am using apply to each and append to variables.

However this method appends email from other Sharepoint items as well.

Regards
Hidayat

 

 

[
 {
 "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
 "Claims": "i:0#.f|membership|m.hidayat@Random.com",
 "DisplayName": "Hidayat",
 "Email": "M.Hidayat@Random.com",
 "Picture": "https://.com",
 "Department": null,
 "JobTitle": null
 },
 {
 "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
 "Claims": "i:0#.f|membership|sin.wong@Random.com",
 "DisplayName": "Derrick",
 "Email": "Sin.Wong@Random.com",
 "Picture": "https://.com",
 "Department": null,
 "JobTitle": null
 }
]

 

 

 Capture.JPG

Categories:
I have the same question (0)
  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Yatz  can you please give a little background of your scenario here for me to understand the issue better. I am not sure why you have three Apply to each nested here, can you describe your SharePoint list and what you want to get from the list?

  • HM-18111627-0 Profile Picture
    18 on at

    Hi @annajhaveri ,

    I am extracting unique records from SP using the process from below link.
    Power Automate Get Unique Values from Array | Distinct Items from Excel, SharePoint & Dataverse 

    One of the columns I wanted to populate is the CopyTo column where multiple email addresses are stored. The email address will be used as CC when sending out Email later on.

    In the step Apply to Each 2, Compose, I managed to extract the object out with the following output.

    Capture.JPG

     

    [
     {
     "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     "Claims": "i:0#.f|membership|m.hidayat@Random.com",
     "DisplayName": "Hidayat",
     "Email": "M.Hidayat@Random.com",
     "Picture": "https://.com",
     "Department": null,
     "JobTitle": null
     },
     {
     "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     "Claims": "i:0#.f|membership|sin.wong@Random.com",
     "DisplayName": "Derrick",
     "Email": "Sin.Wong@Random.com",
     "Picture": "https://.com",
     "Department": null,
     "JobTitle": null
     }
    ]

     

     

    The end result image would be as follow:

     

    Type String:
    
    m.hidayat@Random.com; Sin.Wong@Random.com

     

     

    Regards

    Hidayat

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Yatz  okay, so you have a SharePoint list with People and Group column, correct? Is that single valued or multi valued column? Are you looking to combine email address from a specific list item column value or from all list items column value?

  • HM-18111627-0 Profile Picture
    18 on at

    Hi @annajhaveri ,

    It is a multi people column, named CopyTo.
    I am looking to join all email address from a specific item list with this column.

    Regards
    Hidayat

  • Verified answer
    annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Yatz  you can combine the multi valued person column into string of comma separated email address using below steps:

     

    1. Add select action as shown below, and in from select the multi valued person column value from dynamic content and in map use below expression

    item()?['Email']

    annajhaveri_0-1678100209951.png

     

    2. Add Compose action and use below expression

    join(body('Select'),',')

     

    The output of compose action will be comma separated values of all emails from the multi valued person field value.

  • HM-18111627-0 Profile Picture
    18 on at

    Thank you so much @annajhaveri !
    You are right, there is no need for 3 actions of apply to each to do this.

    I needed to add an additional step to extract the first record else it will give an apply to each after Select statement.

     

    first(body('GroupUniqueKey'))?['CopyTo']

    Yatz_1-1678154214078.png

     

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard