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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Attachment content can...
Power Automate
Answered

Attachment content cannot be null or empty

(1) ShareShare
ReportReport
Posted on by 13

Hi all,

 

I know this question has been asked before but there was no solution so I figured I'd ask again.

 

I built a simple but fairly long flow that takes the information from a SharePoint list entered from Powerapps, translates it, then creates two different pdf's (Spanish and English) and sends it out in an email to multiple recipients. 

 

The flow works 50% of the time with the other 50% occurring at the very last step [send an email(V2)], giving me the error:

 

Parameter 'Attachment Content' cannot be null or empty.
clientRequestId: 37adc4f7-288a-4616-b4f8-cdd7cf65835b

 

 

The attachment content is not null, I have dynamic files running, there is nothing hard coded, I have even tried adding delays and switching around the flow. 

 

The only temporary fix is building the flow from scratch each time which is terribly time consuming. 

 

Any help is appreciated! TIA

Categories:
I have the same question (0)
  • jinivthakkar Profile Picture
    4,187 on at

    Can you please share screenshots ? and if there are multiple attachments are you iterating in a loop and then getting attachment content for each file ?

     

    Please check this link : 

     

    https://www.techmeet360.com/blog/how-to-send-an-email-attachment-using-microsoft-flow/

     

  • HEATFreight Profile Picture
    1,024 on at

    I have an attachment which is clearly not empty, yet my flow has an email error.

     

    "body":{"status":400,"message":"Parameter 'Attachment Content' cannot be null or empty.\r\nclientRequestId: 2c948bd4-b51d-4097-861f-44dfdccb8d14","error":{"message":"Parameter 'Attachment Content' cannot be null or empty."},"source":"office365-wus.azconn-wus-01.p.azurewebsites.net"}}

     


    The output from the "Get file content using path" action is this

     

    { "$content-type": "application/pdf", "$content": "JVBERi0xLjQKJaqr....=" }

     


    And the attachment is attached using the normal way (not as an array). Like

    Name.pdf


    and

    @body('Get_file_content_using_path')?['body']



    How can this be null? Is this a transient issue that will fix itself? I worry that I am over my OneDrive data quota, and not sure how to fix.

  • HEATFreight Profile Picture
    1,024 on at

    Ok now I have passed in the attachment as an array via a compose function:

    {
     "Name": @{outputs('Get_file_metadata_using_path')?['body/DisplayName']},
     "Content": @{body('Get_file_content_using_path')?['body']}
    }


    And the compose:

    @{variables('Array')}




    Attachments (Send an email V2):

    [
     {
     "Name": "Name.pdf",
     "Content": {
     "$content-type": "application/pdf",
     "$content": "JVBERi0xLjQKJaqrrK0KMSAwIG9iago8PAo...="
     }
     }
    ]

     
    Error details:

    The 'inputs.parameters' of workflow operation 'Send_an_email_(V2)' of type 'OpenApiConnection' is not valid. Error details: The API operation 'SendEmailV2' is missing required property 'emailMessage/Attachments/0/ContentBytes'.



     

  • gpohlod Profile Picture
    38 on at

    Hi @abhender ,

     

    Are you sending one email or multiple emails at the same time?

     

    If multiple emails, try adding a delay of 20 seconds between emails and see if that helps. It seems to have solved my issue. 

  • HEATFreight Profile Picture
    1,024 on at

    Hey @abhender, I solved my problem by figuring out the difference between "Content" and "ContentBytes".

    Certain scenarios require one or the other, and I don't really understand it, but I know when to use each one for my use cases. If you are having trouble, switch to the other and see if it fixes the problem, like:

    {
     "Name": @{outputs('Get_file_metadata_using_path')?['body/DisplayName']},
     "Content": @{body('Get_file_content_using_path')?['body']}
    }

    vs.

    {
     "Name": @{outputs('Get_file_metadata_using_path')?['body/DisplayName']},
     "ContentBytes": @{body('Get_file_content_using_path')?['body']}
    }
  • Ian @ SU Profile Picture
    6 on at

    I am getting the same issues, sending one email with 2 attachments. Both attachments are valid, as saving them to OneDrive works consistently immediately before the send as email. I tried the suggestion from @HEATFreight; the default in my PowerApps is to use "ContentBytes": for the attachment, and it gives me an error if I change it to "Content":  I am wondering if it could be a timeout issue, as it seems more likely when the attachments are larger (around 2Mb in my task - a PDF). It also works fine sometimes, and not others, with no change to the script. 

  • gpohlod Profile Picture
    38 on at

    Hey @goodingip ,

     

    I found it's very inconsistent and the only way I've been able to get it working consistently was to build it as a solution that calls child flows. The parent flow passes the path info of the file to the child flow which gets it from in my case SharePoint, then attaches the email and sends and returns to the parent flow, so it can call the next email. 

     

     

  • Verified answer
    abhender Profile Picture
    13 on at

    Thanks everyone for the replies, the flow started working shortly after I posted this message. The fix was that I had to upload all of the translated versions (documents) to the SharePoint list first as an attachment. Unlike before, I just had my array pulling the generated files as soon as they became translated. Then I used the whole "get attachments" scenario to grab them all again and put them in an array to be emailed. (There are some skipped steps below but they're not pertinent to the flow working). Hope this helps.

     

    abhender_1-1617030369630.png

    abhender_3-1617030847842.png

     

     

  • Ian @ SU Profile Picture
    6 on at

    That's helpful advice, thanks @gpohlod. I think what is happening in our case is that the licence I'm using isn't meaty enough (PowerApps Plan 2), so we're getting arbitrarily cut off when we do something complex. I've see it randomly stop at other points in our flow, so in our case it doesn't seem to be anything per se to do with the email attachments. 

    See Limits and configuration - Power Automate | Microsoft Docs for how Microsoft have chosen to limit flow functionality unless you buy a per-flow plan. I borrowed a Dynamics 365 licence and it instantly fixed the problem. As a charity, I'm trying to do stuff without fancy licencing, but in this case we're going to have to pay to get the business efficiency we are looking for. 

  • everstab Profile Picture
    6 on at

    Hi,

    I am getting the empty content error message when trying to attach attachments from a SharePoint list to an approval, even though the attachments are NOT empty.  I believe my flow is correct and it does work up until the approval.  I even put in a 5 minute delay since I work in a non-profit and some posts said our version of Power Automate may not be as robust in performance.  I am still getting the same error.  Any help would be greatly appreciated!   

    everstab_0-1624458785845.png

    everstab_1-1624459030334.pngeverstab_2-1624459061527.png

    Thanks,

    Pat

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 820

#3
Haque Profile Picture

Haque 505

Last 30 days Overall leaderboard