i made an app that upload its attachment to power automate so that i can send it to an email, here is formula am using to get attachment data:
Set(data, JSON(Image3.Image, JSONFormat.IncludeBinaryData));
Collect(rawdata, {contentBytes: Mid(data, Find(",", data)+1, Len(data) - Find(",", data) -1), name:Last(Ducements.Attachments).Name});

and here is how it is sent to the flow:
SendEmailAttV2.Run(JSON(rawdata));
here is the flow am using to process the data nd send it in an email:

Schema:
{
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"contentBytes": {
"type": "string"
}
},
"required": [
"name",
"contentBytes"
]
}
}

upon receiving the email, i can not open any of the attachment saying that it is corrupted, they all have correct names and types, here is the flow run:



