cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Microsoft Jesor
Microsoft

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
Dual Super User
Dual 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

View solution in original post

7 REPLIES 7
Dual Super User
Dual 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

Microsoft Jesor
Microsoft

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.

Dual Super User
Dual 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

Microsoft Jesor
Microsoft

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

Microsoft Jesor
Microsoft

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

Dual Super User
Dual 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?

Dual Super User
Dual 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

View solution in original post

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate 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 Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,272)