cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Forwarding an email attachment to a recipient from text string

Hello,

 

TLDR: Can't figure out how to forward email attachment to a new recipient. I only have 1 day of experience using MS Flow. 


I am trying to create an automated flow which extracts an email address from the body of an email, and then forwards the attachment on the original email to said person. I am having two issues: 

 

Issue#1 - I am using the "SPLIT" expression to locate the email address that is in the body of my email (see HTML code below).

After several expressions that should leave me with only the email address

 

  • last(split(variables('Email Body'),'<td colspan="2">SID - Submitter ID </td>'))
  • split(variables('EmailStep1'),'<td colspan="2">')
  • first(split(variables('EmailStep2'),'&nbsp;'))

"<tr>

<td colspan="2">SID - Submitter ID </td>

<td colspan="2">connor.riley@123.com &nbsp; </td>

</tr>"

 

Eventually, (no matter what i do) i end up with something similar to this screenshot below.
Any recommendations? - Am i using the wrong method to extract the email? 
 

Annotation 2019-10-20 202932.jpg

 

Issue#2 - I'm not sure what function i can use to get my attachment from the original email.

I see a funciton to "get attachment" from an email, but it requires an Email ID which i am not sure how to find. 

 

MS Flow Overview.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Forwarding an email attachment to a recipient from text string

Hi @jujernigan,

 

Please refer to these steps to process your HTML content into an Email Address array:

1. Initialize an array variable named EmailAddress.

2. Convert the HTML content into text.

3. Use Split function to create array, I choose blank character as a delimiter in there.

4. Put the output of the Split function (it is an array) into the Apply to each action, then create a condition to determine the member whether having "@123.com", if it has, append it into the EmailAddress array.

5. You can use the compose in the end to check the array, hope it helps.

Annotation 2019-10-22 162132.png

 

Annotation 2019-10-22 162152.png

Best Regards,
Community Support Team _ Lin Tu
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

3 REPLIES 3
Highlighted
Super User II
Super User II

Re: Forwarding an email attachment to a recipient from text string

Look at the dynamic data returned from the trigger.

 

It will hav ethe ID you need for the attachment action.

Highlighted
Community Support
Community Support

Re: Forwarding an email attachment to a recipient from text string

Hi @jujernigan,

 

Please refer to these steps to process your HTML content into an Email Address array:

1. Initialize an array variable named EmailAddress.

2. Convert the HTML content into text.

3. Use Split function to create array, I choose blank character as a delimiter in there.

4. Put the output of the Split function (it is an array) into the Apply to each action, then create a condition to determine the member whether having "@123.com", if it has, append it into the EmailAddress array.

5. You can use the compose in the end to check the array, hope it helps.

Annotation 2019-10-22 162132.png

 

Annotation 2019-10-22 162152.png

Best Regards,
Community Support Team _ Lin Tu
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

Highlighted
Community Support
Community Support

Re: Forwarding an email attachment to a recipient from text string

Hi @jujernigan,

 

Has your problem been solved?
If your problem has been solved, You could go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

Best Regards,
Community Support Team _ Lin Tu

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

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