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 / Content vs ContentBytes
Power Automate
Answered

Content vs ContentBytes

(0) ShareShare
ReportReport
Posted on by 18

Hi

 

I have a flow which keeps failing at sending an email with attachment with a message 

 

The API operation 'SendEmailV2' is missing required property 'emailMessage/Attachments/0/ContentBytes'.

 

having looked through the forums i've seen that "Content" needs to be "ContentBytes"

 

Luke15_0-1631029167674.png

 

but when i amend to this i get the following 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 416.'.'.

 

confused??!!

 

Kind Regards

 

Luke Stork

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    Paulie78 Profile Picture
    8,422 Moderator on at

    it should be $content but that isn't always there depending on the file type of the file that you fetched. But you can make sure it is always there by setting Infer Content Type to no:

    2021-09-07_16-49-48.png

    The action will then provide two outputs:

    $content-type and $content.

     

    You would need your append to array variable step to be something like:

    {
     "content": {
     "$content-type": "@{outputs('Get_file_content_using_path')?['body']['$content-type']}",
     "$content": "@{outputs('Get_file_content_using_path')?['body']['$content']}"
     },
     "Name": "FilenameFromSomewhere"
    }

    You can read a bit more about it on my blog here:

    https://www.tachytelic.net/2020/09/power-automate-add-multiple-attachments-approval-email/ 

     

    Blog: tachytelic.net

    YouTube: https://www.youtube.com/c/PaulieM/videos

    If I answered your question, please accept it as a solution 😘

  • Luke15 Profile Picture
    18 on at

    Thanks but that didnt quite work

     

    i get this error now at the append variable array stage

     

    Unable to process template language expressions in action 'Append_to_array_variable' inputs at line '1' and column '51313': 'The template language expression 'body('Get_file_content_using_path')['body']['$content-type']' cannot be evaluated because property 'body' doesn't exist. Property selection is not supported on content of type 'application/octet-stream'. Please see https://aka.ms/logicexpressions for usage details.'.

  • Paulie78 Profile Picture
    8,422 Moderator on at

    Sorry. You probably want:

    body('Get_file_content_using_path')['$content-type']

     

    Should be correct but slightly tricky as responding from my mobile

  • Luke15 Profile Picture
    18 on at

    unfortunately still getting this error - which is the one i had at the start

     

    
    OpenApiOperationParameterValidationFailed. The 'inputs.parameters' of workflow operation 'Send_an_email_(V2)_3' of type 'OpenApiConnection' is not valid. Error details: The API operation 'SendEmailV2' is missing required property 'emailMessage/Attachments/0/ContentBytes'.
     
    should content-type be contentbytes?

     

  • Luke15 Profile Picture
    18 on at

    I've solved this by following the instructions on the blog

     

    I didnt realise that you needed a separate array for attachments in sharepoint and attachments for email 🙄

     

    Blog: tachytelic.net

  • Paulie78 Profile Picture
    8,422 Moderator on at

    That's a brilliant blog - It's mine 😃

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard