cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kjell
Regular Visitor

Extracting email address field from Person object

I'm working on a flow that sends emails to multiple people.  I'm extracting Person fields from a SharePoint list field that can contain a number of Persons using the Apply to each function.  I then send the data to the Send an email function.

 

The problem that I'm having is that CurrentItem contains the comple Person struct and I need to extract just the Email field from this struct in order for the Send an email function to accept the parameter in the To field.

 

How can I extract this field?

 

Screen Shot.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

if you hover over the current item you will see the JSON representation of the object.  YOu can take that string, enter it in the formula bar in dynamic content and then add ?['email'] to the end of it.  Insert that into the To blank and you'll have the email. It will look something like this

items('Apply_to_each')?['Email']


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

5 REPLIES 5
ScottShearer
Super User III
Super User III

@Kjell 

I may not be understanding your goal totally, but I believe that you are storing the email addresses in the array.  If that is the case, you may want to remove the array.  You can simply loop through each person or group entry - you'll be able to select the email address.  If I am off base, please let me know.

In my example, PG is a person or group column that allows mutliple entries.

MultiPerson.jpg

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Pstork1
Dual Super User III
Dual Super User III

if you hover over the current item you will see the JSON representation of the object.  YOu can take that string, enter it in the formula bar in dynamic content and then add ?['email'] to the end of it.  Insert that into the To blank and you'll have the email. It will look something like this

items('Apply_to_each')?['Email']


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Hi Pstork1,

I have the same issue. can I ask how to "hover over the current item you will see the JSON representation of the object"? I tried this below:

Feb22_3.png

got:

items(('Apply_to_each')?['Requestor']?['Email'])

Put on it on "Required attendees" field:

Feb22_2.png

 

 

 

 

 

 

 

 

 

 

got error message:

Feb22_4.png

Please advice.

Thank you very much.

Linda

Pstork1
Dual Super User III
Dual Super User III

You can't use a value from inside the Loop after the Loop has closed.  That's why I suggested appending the Email to a string variable. The values in the variable will remain after the loop completes.

 

If you hover over an item in the flow a tooltip will appear that shows the JSON for that item.  see screenshot. This is the loop structure I am suggesting.  When you are done the variable will have a list of emails from the people column.  NOTE: its not in the screenshot but you need to add a semicolon after the email when appending to the string to use it as an address.

screenshot.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi Pstork1,

 

It works very well. Thank you very much!!!🙂

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,756)