cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MBach20
Frequent Visitor

Attachment corruption on approval emails

Hello all,

We have created an approval workflow with multiple attachments but we cannot figure out why the attachments don't work once in the the approval email. The screenshot below is the coding which we have used. We tested an approval with 3 attachments; two of them open as blanks and one opens with the error message below. All three attachments are fine when uploaded to the SharePoint list.

MicrosoftTeams-image (3).pngMicrosoftTeams-image (4).png

Tagging @ChristianAbata as you kindly helped solve my previous workflow issue.

Thank you!

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hey @MBach20 

You only need to add the 'File Contents' property inside the base64() expression... you shouldn't add the $content extra elements.

1.jpg

Anyhow you shouldn't need to do this... I have just tested, see below which works:

2.jpg

 

 

HTH

Jay

View solution in original post

Hey @Anonymous 

Please refer to the post... you are using an incorrect JSON element.

ContentBytes should just be content

This video covers this in detail: https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Add-Multiple-Attachments-to-an-Approval/td-p/748527

HTH

Jay

View solution in original post

11 REPLIES 11
ChristianAbata
Super User
Super User

hi @MBach20  please try adding in your json format the next format

 

[{"Name":"asdasd.docx","ContentBytes" : "HERE YOUR CONTENT IMAGE"}]

 

See you have content instead content bytes.

 

Let me know xD 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Jay-Encodian
Community Champion
Community Champion

Hey @MBach20 

Try wrapping the 'File Contents' property in the base64() expression... this will instruct Flow to pass just the base64 $content and not the entire file contents value.

May be of interest - https://blog.encodian.com/2020/07/working-with-file-contents-and-files-in-power-automate/

HTH

Jay

v-bacao-msft
Community Support
Community Support

 

Hi @MBach20 ,

 

If the attachments come from the SharePoint list, you can refer to the following configuration:

58.PNG59.PNG

 

Best Regards,

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

Hi @ChristianAbata 

 

Thank you for your reply! 

I understand from previous posts (and have tested this as well) that ContentBytes works for multiple attachments for "send an email", however for approval workflows, the json required is just "Content".

Hi @Jay-Encodian 

Thank you for your reply - we just gave this a go (hopefully we got it right), however the same error appears;

MicrosoftTeams-image.png

MicrosoftTeams-image.png

Hi @v-bacao-msft 

Thank you for your reply! We copied the exact output you have provided, however the following error appears:

MicrosoftTeams-image.png

Hey @MBach20 

You only need to add the 'File Contents' property inside the base64() expression... you shouldn't add the $content extra elements.

1.jpg

Anyhow you shouldn't need to do this... I have just tested, see below which works:

2.jpg

 

 

HTH

Jay

Thank you!
Anonymous
Not applicable

@Jay-Encodian 

 

sbtrying_1-1611247132479.png

How do I fix this error?

 

 

 

Hey @Anonymous 

Please refer to the post... you are using an incorrect JSON element.

ContentBytes should just be content

This video covers this in detail: https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Add-Multiple-Attachments-to-an-Approval/td-p/748527

HTH

Jay

Jay:  I am having a similar issue, all attachments within the email are corrupt.  Could you help explain what I am doing wrong?

 

tinalamkey_0-1654716138901.png

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (4,287)