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 :
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:
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!
Solved! Go to Solution.
@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'))} }
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!
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
Hi Ben, I tried your way:
but the flow still fails, and returns this error:
Looks like the same error. what is your expression in the append to array? I think this maybe where the problem is.
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?
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.
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/
Hi @Derek4,
The "ContentBytes": File content could work:
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.
@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:
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!
I think it's the add attachment to approval failed, Get file content action is successful.
@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 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'))} }
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!
@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!
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
45 | |
45 | |
38 | |
35 | |
23 |
User | Count |
---|---|
48 | |
32 | |
32 | |
31 | |
29 |