Hello All,
I am trying to use an Array to send and email with attachments. However when I use an Array the attachments fail to open.
I have Initialized a variable Array called - AttachmentsArray
I create a file in Sharepoint, then I update the file properties, then I Get the file content of the updated file.
Then I Append to the Array.
{
"Name": "FMLAN-@{triggerBody()['text']}",
"ContentBytes": "base64(body('Get_file_content_-_Updated_FMLAN'))"
}
(I have tried both this way and not using the base64 and just "ContentBytes": "@{body('Get_file_content_-_Updated_FMLAN')}") both give me the same result.
I then use the AttachmentsArray variable in the attachments section of my Send an email (V2) action.
When I get the email the file appears to be attached but will not open in Outlook for a preview, it states that it ran into a problem and I need to open it in the desktop application. When I try to do that I get a message that Word found unreadable content.
The attachment when I use the array show to be 1MB. However when I directly attach the file not using the array the attachment works and it shows to be 750KB.
The attachments works when I use the Get file content Updated FMLAN file content for the content field in the email.
@{body('Get_file_content_using_path_-_FMLA_Notice')}
But I have several documents that may or may not need to be attached to this email based on choices the user makes in my app so I need to use the array to that I can dynamically add them.
Thanks for any help.