Creating an array to pass attachments into an email
I am currently trying to figure out what I am doing wrong on a power automate flow that I created. We are receiving an submission from a Survey123 form where the person will have 1+ attachments that I would like to have sent as attachments in an email to a department. i am doing an apply to each cycling through the attachments and doing an http get and then passing the body of that http to an array.
{
"Name": "@{items('Apply_to_each_2')?['name']}",
"ContentBytes": "@{body('HTTP')?['$content']}"
}
I am then doing the same thing for a report created in sharepoint where I am appending to the same array as above with
{
"Name": "@{outputs('Create_file_2')?['body/Name']}",
"ContentBytes": "@{body('Get_file_content')}"
}
The problem I am having is the attachments are being shown in the email but they are corrupted and cant be opened or if the pdf is openable its an empty white page even though I can see the file in our sharepoint.