Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

add email attachment with files from Form

(0) ShareShare
ReportReport
Posted on by 185

Hello,

 

I'm building an approval flow with guidance from the following link:

https://www.bythedevs.com/post/working-with-files-on-ms-forms-in-ms-power-automate

 

and my flow is like this :

 

微信截图_20200904101231.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

when I run the flow it returns an error:

The request failed. Error code: 'InvalidRequestContent'. Error Message: 'The request content was invalid and could not be deserialized: 'Could not find member 'ContentBytes' on object of type 'ApprovalsConnectorAttachment'. Path 'attachments[0].ContentBytes', line 1, position 454.'.'.

 

I think it has something to do with the append to attachment array:

微信截图_20200907115603.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

for the Content/ContentBytes, I have tried the following:

"Content": File content

"Content": base64(File content)

"ContentBytes": File content

"ContentBytes": base64(File content)

none of the above works, I don't know what to do now.

 

Can anyone help me with this?

Thanks in advance!

 

  • CFernandes Profile Picture
    8,295 Most Valuable Professional on at
    Re: add email attachment with files from Form

    Hey @lucasheck 

     

    I am glad that your problem has been resolved 🙂

     

     

  • lucasheck Profile Picture
    4 on at
    Re: add email attachment with files from Form

    Thanks @CFernandes  and @Derek4 . I was having the same problem here. It worked just fine.

    You both saved my night!

  • CFernandes Profile Picture
    8,295 Most Valuable Professional on at
    Re: add email attachment with files from Form

    @Derek4 I am glad that you could resolve the problem. 🙂

  • Derek4 Profile Picture
    185 on at
    Re: add email attachment with files from Form

    @CFernandes  It's very strange, I did exactly what you told me and again the flow succeed but the attachment corrupted. But when I change the Base64(File content) to File content, the flow succeed and the attachment is OK.

     

    I did use Content: File content before and it just like "the flow succeed but the attachment corrupted", I don't know what's wrong but now it working as planned. 

     

    Thank you!

  • Verified answer
    CFernandes Profile Picture
    8,295 Most Valuable Professional on at
    Re: add email attachment with files from Form

    @Derek4 No worries we will get around in can you post a screenshot of how passed the attachment?

     

    Perhaps you might want to decorate the 'File Content' with the base64() function.

     

    {
    "Name": @{items('Apply_to_each')?['DisplayName']},
    "Content": @{base64(body('Get_file_content'))}
    }

     

    Untitled.png

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Derek4 Profile Picture
    185 on at
    Re: add email attachment with files from Form

    @CFernandes  I tired your way, the flow is successful, but the attachment is corrupted:

    微信截图_20200908162354.png

     

  • CFernandes Profile Picture
    8,295 Most Valuable Professional on at
    Re: add email attachment with files from Form

    @Derek4 The Error tells me "Could not find ContentBytes" please change ContentBytes to Content  with reference to the screenshot in my previous update. 

     

    Note: Approvals action does not recognize ContentBytes and so you need to use the Content key to pass the file content. 

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Derek4 Profile Picture
    185 on at
    Re: add email attachment with files from Form

    I think it's the add attachment to approval failed, Get file content action is successful.

    微信截图_20200908161338.png

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • CFernandes Profile Picture
    8,295 Most Valuable Professional on at
    Re: add email attachment with files from Form

    @Derek4 Approvals action does not recognize contentbytes and so you need to use the content key to pass the file content. 

     

    Please configure the action with reference to screenshot below:

     

    Untitled.png

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

     
  • v-litu-msft Profile Picture
    on at
    Re: add email attachment with files from Form

    Hi @Derek4,

     

    The "ContentBytes": File content  could work:Annotation 2020-09-08 104646.jpg

     

    Which step reports the error? Get file content action works well?

    The request failed. Error code: 'InvalidRequestContent'. Error Message: 'The request content was invalid and could not be deserialized: 'Could not find member 'ContentBytes' on object of type 'ApprovalsConnectorAttachment'. Path 'attachments[0].ContentBytes', line 1, position 454.'.'.

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1