Hello,
I need your expert advice in an Power Automate problem.
I would like to automatically process some email with attachments that should be sent to an approval process.
I have tried to get some inspiration from couple of articles:
I get the attachments into the approval email except they cannot be opened.
I have tried to replicate the original articles and from a SharePoint item it works perfectly.
What is different in my case - I get the attachments from an email message (that could return different type of data) and also composing the "AttachmentsArray" may have a different JSON format.
I have tried some simple JSON format:
{
"Name": "@{outputs('Get_Attachment_(V2)')?['body/name']}",
"Content":"@{outputs('Get_Attachment_(V2)')?['body/contentBytes']}"
}
and even a more complex one:
{
"Name": "@{outputs('Get_Attachment_(V2)')?['body/name']}",
"Content": {
"contentType": "@{outputs('Get_Attachment_(V2)')?['body/contentType']}",
"contentBytes": "@{outputs('Get_Attachment_(V2)')?['body/contentBytes']}"
}
}
Tried even a base64 and base64ToString function to the content section but no luck. I get the correct email names in the approval email but bad content because files cannot be opened.
Here is the entire process, if may help in pointing me to the right direction:

I feel that Append To Array card is the culprit:

Which as the following code in this moment:
{
"inputs": {
"name": "ApprovalAttachmentsArray",
"value": {
"Name": "@{outputs('Get_Attachment_(V2)')?['body/name']}",
"Content": "@{base64ToString(outputs('Get_Attachment_(V2)')?['body/contentBytes'])}"
}
}
}
Any ideas? Which is the proper conversion from email attachments as the SharePoint list attachments are working properly?
Kind Regards,
Lucian