How to add multiple attachments to an email using the "Send an email (V2)" action in Powerautomate

Methe, David 0 Reputation points
2026-10-30T14:24:00.4433333+00:00

The "Send an email (V2)" action couldn't send your email because it expected a list of attachments the flow fails.

I'm using a "Get attachment content" and "Append to array variable" functions in a "For each" loop.

How do I configure the "Attachments" field using an array variable (not a single value).

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments

2 answers

Sort by: Newest
  1. Julie Huynh 4,265 Reputation points Independent Advisor
    2026-10-30T16:13:10.81+00:00

    Dear @Methe, David ,

    Good day! Welcome to Microsoft Q&A forum!

    Thank you for providing the details. Based on your description, it sounds like the Send an email (V2) action may not be receiving the attachments in the format it expects.

    As a general approach, you can try the following:

    1. Initialize an Array variable before the loop (for example, varAttachments).
    2. Within the Apply to each loop, use Append to array variable to add an object containing:
      • Name = attachment file name
      • ContentBytes = attachment content
    3. Place the Send an email (V2) action outside the loop.
    4. In the Attachments field, select "Switch to input entire array" and pass the array variable directly (for example, variables('varAttachments')).

    User's image

    User's image

    User's image

    User's image

    If the issue persists after trying the above, I would also recommend posting in the Power Automate Community Forum, where Power Automate specialists and community experts can provide more in-depth assistance with flow design and connector-specific behavior. With the additional screenshots and error details, they should be able to help identify the exact cause more quickly.

    Thank you for your patience and understanding!

    Was this answer helpful?


  2. AI answer

    2026-10-30T14:24:43.6833333+00:00

    Configure the array as a list of attachment objects containing exactly Name and ContentBytes, then pass the completed array—not an individual item—to Send an email (V2).

    Configure the cloud flow

    1. Before the Apply to each loop, add Initialize variable:
      • Name: EmailAttachments
      • Type: Array
      • Value: leave empty ([])
    2. Keep Get attachment content inside your existing Apply to each loop.
    3. In Append to array variable, select EmailAttachments and append this object:
    {
      "Name": "<attachment file name>",
      "ContentBytes": "<output of Get attachment content>"
    }
    

    Use Dynamic content for both placeholders:

    • Name: the attachment’s file-name property from Get attachments—often displayed as DisplayName or Name.
    • ContentBytes: File content or the body output from Get attachment content.

    The property names are case-sensitive for this scenario: use PascalCase Name and ContentBytes, not name, contentBytes, Content, or another schema. A matching multi-attachment failure was resolved by correcting those property names to PascalCase.^1^

    Microsoft’s Office 365 Outlook guidance likewise specifies that every attachment object must contain Name and ContentBytes, and that the completed list must be passed to the action’s Attachments property.^2^

    1. Place Send an email (V2) after and outside the Apply to each loop. This ensures the array contains every attachment before the email is sent.
    2. Open Send an email (V2) → Advanced parameters → Attachments:
      • Select the option to switch to input the entire array, if shown by the designer.
      • Insert the EmailAttachments variable as the complete value.
      • Do not place the variable separately into an individual attachment’s Name or Content field.

    The final structure should be:

    Initialize EmailAttachments (Array)
    Apply to each attachment
        Get attachment content
        Append attachment object to EmailAttachments
    Send an email (V2)
        Attachments = EmailAttachments
    

    If the designer still rejects the value

    Add a Compose immediately before the email action with:

    variables('EmailAttachments')
    

    Run the flow and inspect the Compose output. It should resemble:

    [
      {
        "Name": "Invoice.pdf",
        "ContentBytes": "<binary/base64 content>"
      },
      {
        "Name": "Photo.jpg",
        "ContentBytes": "<binary/base64 content>"
      }
    ]
    

    If the email action runs before the loop that builds this output, change its Run after dependency or move it below that loop. The matching Q&A resolution also required the send action to run only after all attachment-processing loops had completed.^1^


    References

    1. LogicApp failure when attaching multiple files to email. - Microsoft Q&A
    2. Office 365 Outlook
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.