web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Assistance with Automa...
Power Automate
Suggested Answer

Assistance with Automating Email Attachment Processing via Power Automate

(0) ShareShare
ReportReport
Posted on by 25

Hi everyone,

 

In my flow, I process incoming emails with attachments and generate a new file (saved in OneDrive). At the end, I send an email that should include both:


  • The generated file

  • The original email attachments.

To store the original attachments, I created an array variable (AllAttachments) during the flow.

However, due to formatting constraints, I’m limited to using HTML in the "Send an email (V2)" action — which makes it unclear how to attach both the generated file and the contents of the array.

Any advice on how to make this work within the HTML-based setup?

Thanks,

Ettore

Categories:
I have the same question (0)
  • Suggested answer
    Tomac Profile Picture
    3,966 Moderator on at
    Are you trying to include a link to the files, or attach the files directly to the email?
     
    You can use the anchor tag in html to make a link, as shown highlighted below. To add an attachment, you'll need to click Show Advanced Options (circled):
     
    and use the Attachments section to add your attachments individually, instead of making an array of attachments:
     
    If this comment solves the issue, please remember to mark it as the answer
  • EM-09071651-0 Profile Picture
    25 on at

    Hi Tomac,

     

    Thanks for the helpful explanation!

     

    I do need to attach the files directly to the email, not just link to them.

     

    I'm using the "When a new email arrives (V3)" trigger, and I want to know:

    How can I access each attachment individually from the incoming email, so I can attach them one by one using the “Attachments” section under “Show advanced options” in the "Send an email (V2)" action?

     

    At the moment, the attachments seem to come through as a collection, and I'm not sure how to reference them separately.

     

    Thanks in advance for your guidance!

     

    Best,

    Ettore

  • Suggested answer
    Tomac Profile Picture
    3,966 Moderator on at
    Here's how I built a flow to accomplish this:
     
    First we set our trigger properties correctly and initialize an array variable:
     
    Then we move into our loop, where we step through @{triggerOutputs()?['body/attachments']}
     
    At the beginning of the loop I'm checking the filetype of the attachment to ensure I'm only targeting the desired filetypes. This is important to filter out signature images. Then I use the Get Attachments action and add the file to my attachments array using the following snippet:
    {
       "contentbytes": {
          "$content-type": "@{outputs('Get_Attachment_(V2)')?['body/contentType']}",
          "$content": @{outputs('Get_Attachment_(V2)')?['body/contentBytes']}
       },
       "Name": "@{outputs('Get_Attachment_(V2)')?['body/name']}"
    }
    This array format is essential for your files to not be corrupt!
     
    Then I send the email using the array for the attachments. If you don't see the option to enter an array, click the highlighted button:
     
     
    In my testing this array format works properly across email clients.
     
    If this comment resolves your issue, please remember to mark it as the answer.
  • EM-09071651-0 Profile Picture
    25 on at

    Hi Tomac,

     

    Thank you again — your explanation was really helpful and helped me move forward!

     

    Right now, I’m only facing one last issue. For some reason, Power Automate doesn’t let me send both the attachment array and the individually created file in the same “Send an email (V2)” action.

     

    As shown in the screenshot below, I’ve tried using one “Send an email (V2)” action with the full array of attachments, and another one where I add a file individually by name and content — but I can't seem to combine both methods in a single step.

     

    Do you know if there's a workaround to send both together, or would I need to merge the array with the manually created file somehow?

     

    Thanks again for your support!

     

    Best,

    Ettore

  • Tomac Profile Picture
    3,966 Moderator on at
     
    You should be able to use another Append To Array action with the outputs of your OneDrive action, and then just use the Send Email action that uses the array.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard