cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jujernigan
Level: Power Up

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
Community Support Team
Community Support Team

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
Gristy
Level 10

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.

Community Support Team
Community Support Team

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

Community Support Team
Community Support Team

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Kudoed Authors
Users Online
Currently online: 105 members 5,333 guests
Please welcome our newest community members: