logo
search
Others

How to Fix Power Automate Attachment Name Cannot Be Empty Error

Huda QurayshiHuda Qurayshi Sep 25, 2026 869 views

Question details

The user needs to fix an email automation error where the flow fails because the attachment name is missing or invalid.

How to Fix the Power Automate Attachment Name Cannot Be Empty Error
Product
Power Automate
Device & OS
not provided
Scenario
Adding file attachments to an email using the Send an email (V2) action in a workflow.
Observed behavior
The flow execution fails, reporting the error message that Attachment Name cannot be null or empty.
Before you start

Verify that your flow is correctly pointing to the source file or list item, and ensure that the item you are retrieving actually contains an attachment.

Solution 1Recommended

Rebuild the Attachment Array Object Properly

Retrieve the attachments from the newly created destination item and map the DisplayName and ContentBytes correctly into an array variable before sending the email.

The Send an email (V2) action requires a strictly formatted array object for attachments. If the flow retrieves attachments from a source, you must ensure that both the name and the binary content are explicitly extracted and appended to a variable.

1
Add Get Attachments Action

Insert a 'Get attachments' action into your flow to fetch the attachment metadata from the target list or file location.

2
Get Attachment Content

Add a 'Get attachment content' action to retrieve the actual file binary data for the specific attachment.

3
Append to Array Variable

Create an 'Append to array variable' action. In the value field, construct the JSON object like this: { "Name": "@{item()?['DisplayName']}", "ContentBytes": "@{body('Get_attachment_content_2')}" }.

4
Insert into Email Action

In your 'Send an email (V2)' action, switch the Attachments field to array mode (using the T-shaped icon) and insert your completed array variable.

Rebuild the Attachment Array Object Properly
Use DisplayName: Always make sure to use 'DisplayName' instead of 'Name' from dynamic content when retrieving SharePoint item attachments, as 'Name' may sometimes return an empty string.
Free Microsoft Office alternative

Looking for a Lightweight Office Solution? Try WPS Office

While troubleshooting complex Microsoft automation flows, you may want an easier, seamless alternative for your daily document editing needs. WPS Office is a comprehensive, free office suite that makes creating and managing documents, spreadsheets, and presentations simple and efficient.

  1. 1. Visit the Official Site: Go to the official WPS Office website to download the free installer for your operating system.
  2. 2. Install the Software: Run the downloaded executable file and follow the quick installation prompts.
  3. 3. Open and Edit: Launch WPS Office and instantly open your existing Office files without losing any formatting.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Lightweight architecture for faster startup and smoother document loading.Built-in PDF editing tools for easy document conversion and annotation.Familiar, intuitive tabbed interface designed for a seamless transition.
QA img-9

Frequently Asked Questions

Why does my attachment name appear as null in Power Automate?

This commonly happens if the dynamic content mapped to the attachment name field is incorrect. When using the 'Get attachments' action, you should use the 'DisplayName' property instead of a generic name field which may return null.

How do I attach multiple files in the Send an email (V2) action?

To attach multiple files, you must initialize an array variable at the start of your flow. Then, use an 'Apply to each' loop to append a structured JSON object containing 'Name' and 'ContentBytes' for every attachment to that array. Finally, pass the array variable into the email action.

What is ContentBytes in a Power Automate attachment object?

The ContentBytes property represents the actual binary file content of your attachment. Simply providing a file name or path is not enough; you must use a 'Get file content' or 'Get attachment content' action to fetch this binary data and assign it to the ContentBytes property.