Hi everyone,
I am trying to create a flow with an array of an attachments and I have followed some of the other articles on here to get help however none of them seem to be resolving my issue.
In the flow, I get the attachments from my original email, and then reattach a few of these to another email later in the flow.
When I test using the attachments section of the 'Send an email v2', this sends my image file with no issues and I can open it on the other end (seen below)
However when I use the same code to append my image to an array variable, my image file is corrupt on the other end and looks something like this:
I have added images of the full flow below. I would really appreciate if someone can identify where I'm going wrong! ๐ Thank you
Solved! Go to Solution.
You shouldn't to wrap in base64() as the 'Content Bytes' property in the array should accept a full file contents schema... the base64() expression would just write in the $content value... which can cause issues in arrays.
@chloelawr - if you are trying to add the output from the Encodian action to the array then you need to wrap the Encodian 'File Contents' property in the base64ToBinrary() expression when writing the value into the array variable...
I know this seems odd as the Encodian 'File Contents' is already just as a Base64 string... but, Power Automate will silently re-encode the base64 value and thus you'll get a corrupt output. By wrapping in the base64ToBinary() you are informing PA that this is a file and do not re-encode.
Check out this video which explains this in detail: Add multiple attachments to an email in Power Automate
HTH
Jay
@Expiscornovus thanks but sadly this didn't work and I got the same issue.. although it was close ๐
@Jay-Encodian it isn't actually the encodian image I am trying to attach, I am just using the encodian image resizer so my AI Logo detector model actually works as the file size was too small before.
However, I used base64tobinary as you advised with the dynamic content I needed and this has worked! Thanks very much
Hi @chloelawr,
Can you try and apply the base64 function to your ContentBytes when appending it in your array variable?
Let me know if that works.
With kind regards,
Dennis
You shouldn't to wrap in base64() as the 'Content Bytes' property in the array should accept a full file contents schema... the base64() expression would just write in the $content value... which can cause issues in arrays.
@chloelawr - if you are trying to add the output from the Encodian action to the array then you need to wrap the Encodian 'File Contents' property in the base64ToBinrary() expression when writing the value into the array variable...
I know this seems odd as the Encodian 'File Contents' is already just as a Base64 string... but, Power Automate will silently re-encode the base64 value and thus you'll get a corrupt output. By wrapping in the base64ToBinary() you are informing PA that this is a file and do not re-encode.
Check out this video which explains this in detail: Add multiple attachments to an email in Power Automate
HTH
Jay
@Expiscornovus thanks but sadly this didn't work and I got the same issue.. although it was close ๐
@Jay-Encodian it isn't actually the encodian image I am trying to attach, I am just using the encodian image resizer so my AI Logo detector model actually works as the file size was too small before.
However, I used base64tobinary as you advised with the dynamic content I needed and this has worked! Thanks very much
Hi @chloelawr Good news ๐
Basically, if the value you are writing into the array variable is just a base64 string then it needs to be wrapped in the base64ToBinary() expression otherwise PA will silently re-encode the base64() again! The difficulty is you can't see this change in the run history.
Thanks @Jay-Encodian.. understood! I was trying with so many different scenarios so I'm glad I gave up in the end and came to ask the community.. I would have never got it otherwise ๐
Thanks @Jay-Encodian, I wasn't aware it silently re-encodes it and you have to use the base64ToBinary() expression. Good to know ๐
Join digitally, March 2โ4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
User | Count |
---|---|
89 | |
59 | |
42 | |
35 | |
32 |
User | Count |
---|---|
79 | |
67 | |
57 | |
49 | |
42 |