A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
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
- Before the Apply to each loop, add Initialize variable:
- Name:
EmailAttachments - Type:
Array - Value: leave empty (
[])
- Name:
- Keep Get attachment content inside your existing Apply to each loop.
- In Append to array variable, select
EmailAttachmentsand 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^
- 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.
- 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
EmailAttachmentsvariable 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