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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / add email attachment w...
Power Automate
Unanswered

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!

 

Categories:
I have the same question (0)
  • BenRenshaw Profile Picture
    43 on at

    Hi! When I create my file from an MS Form I follow these steps:

     

    Parse JSON of file upload 

    Compose Variable Name 

    Get files contents using path  - /Apps/Microsoft Forms/MYFOLDER/Question/@{outputs('Compose')} using the variable i just composed 

    Then I create the file in SharePoint, but the get file contents could be used in the email attachment. 

     

    Hope this helps

    Ben 

     

     

     

    BenRenshaw_0-1599541822347.png

     

  • Derek4 Profile Picture
    185 on at

    Hi Ben, I tried your way:

    微信截图_20200908151350.png

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    but the flow still fails, and returns this error:

    微信截图_20200908151555.png

     

     

     

     

     

     

     

    Looks like the same error.  what is your expression in the append to array? I think this maybe where the problem is.

  • BenRenshaw Profile Picture
    43 on at

    In your form - how many attachments are being uploaded? Is it multiple? I am not appending to the array, you can just add the attachments in the send email? 

  • Derek4 Profile Picture
    185 on at

    I'm uploading multiple (2) attachments, the flow I'm building requires multiple attachments. I once tried single attachment, the flow run successfully but the attachment is corrupted and I can open it.

  • BenRenshaw Profile Picture
    43 on at

    I think youre on the right track, if you click the T it will allow you to input an entire array. 

    This article is better at explaining than me!! https://flow.microsoft.com/en-us/blog/multiple-attachments-single-email/

    BenRenshaw_0-1599551342595.png

    BenRenshaw_1-1599551397617.png

     

     

  • v-litu-msft Profile Picture
    on at

    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.

  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    @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!

     

     
  • Derek4 Profile Picture
    185 on at

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

    微信截图_20200908161338.png

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    @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

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

    微信截图_20200908162354.png

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard