cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jesor
Level: Powered On

How to extract an attribute from Export Email (V2) properties

Hi, I'm using the Export Email (V2) action to get all of the contents of an email that comes into an inbox based on criteria.  I am able to get the return of all of the values, but I cannot figure out how to get a specific attribute, the 'Reply-To' attribute to be on it's own so I can use that value.

 

What returns is a bunch of things, and that 'Reply-To' field I need to use again in a bunch of other properties of the email.

Ex of the 'Reply-To' returned values: 
Reply-To: "First Last" <contoso@live.com

 

In short, the problem I'm trying to resolve, is that when an email comes in from SharePoint Online as an access request via an external user, I need to be able to gather that user's email address and log it into a sharepoint list and add date to the created day so we know when to remove them from the site collection.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to extract an attribute from Export Email (V2) properties

Hi @Jesor 

 

 

first create a Compose action 

rename it to NewLine

and use following expression

decodeUriComponent('%0A')

Untitled.png

then use expression below in a new Compose action

split(body('Html_to_text'),outputs('NewLine'))

 
this will give you an array of every item in the message body
 
then use Filter action and search where text begins with Reply-To
 
This is a complete hack to get the data if it is not available as a direct dynamic content action
 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

7 REPLIES 7
Super User
Super User

Re: How to extract an attribute from Export Email (V2) properties

Hi @Jesor 

 

Is that not the To field property?

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Jesor
Level: Powered On

Re: How to extract an attribute from Export Email (V2) properties

Hi @RezaDorrani,

 

Nope, the To property can be accessed easily, but in this case when SharePoint sends an access request email to the admin, you will get the From line as, no-reply@sharepoint.com.  This email address though, when you reply to the email, will flip to whatever the property of the Reply-To is, so you will be not replying to the 'no-reply@sharepoint.com' alias, but you will instead be replying to the actual email value of the Reply-To field.  It's like a reroute. 

 

I'm trying to somehow extract that value from all of the properties that are returned from that Export Email (V2) function to get that Reply-To value to use for other purposes.

Super User
Super User

Re: How to extract an attribute from Export Email (V2) properties

Hi @Jesor 

 

do you see this value hidden or available in any of the properties exposed by export mail

Jesor
Level: Powered On

Re: How to extract an attribute from Export Email (V2) properties

The return response from the 'Export Email (V2)' only gives you back the body of the email, thus the backend properties of everything about that email, including where it's from, how it's routed, etc.

 

Below is a screenshot of the body's return.  It's not structured in a way that attributes can be pulled, so other processing seems like it needs to be done before it can be used.  You'll see on line 76 of this instance that the Reply-To property is addressed.  I had to do some alteration of the actual values to mask for privacy reasons, but the return is still in a similar format.

 

returnEmailPropertiesFlow.png

Jesor
Level: Powered On

Re: How to extract an attribute from Export Email (V2) properties

Sorry for multiple messages at once split up, here is the flow set up, I take the message ID from dynamic field to push into the Export Email so I can identify the specific email to grab properties from.

messageID.png

Super User
Super User

Re: How to extract an attribute from Export Email (V2) properties

Hi @Jesor 

 

Sorry I am not able to get reply-to in my post response

 

Not sure what is different

 

Can you check the properties of export email and see if you get it anywhere?

Super User
Super User

Re: How to extract an attribute from Export Email (V2) properties

Hi @Jesor 

 

 

first create a Compose action 

rename it to NewLine

and use following expression

decodeUriComponent('%0A')

Untitled.png

then use expression below in a new Compose action

split(body('Html_to_text'),outputs('NewLine'))

 
this will give you an array of every item in the message body
 
then use Filter action and search where text begins with Reply-To
 
This is a complete hack to get the data if it is not available as a direct dynamic content action
 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 524 members 5,333 guests
Please welcome our newest community members: