Many years ago, I put out
this video showing how to take files uploaded to a MS Forms "file upload" question and send them as email attachments. Someone found it and recently commented that they were having a problem with the files coming through. I built a new flow and tested and it appears that something may have changed about how the output of the "Get file content" action works.
The general process is:
- Get response details
- Use a "parse json" action to transform the response to the file upload question
- Run an "apply to each" loop on the output of the parse json action
- Within that loop, use the OneDrive "get file content" action to get the file's contents
- Append an array with the name and contents of the files in this format:
{
"Name": "<name of the file>",
"ContentBytes": "<output of the 'get file content' action>"
}
The problem is that that append to array action used to look like this (in a completed flow run):
But now it looks like this:
Interestingly, if I drop the SAME dynamic content (the singular output of the "Get file content" action) into a Compose, it looks like it should:
I went as far as trying to put the output of that Compose into the "ContentBytes" field, but the end result was still the same. To be clear, the file does attach and the email sends, but the file cannot be opened. This is the message it gives trying to open the preview in Outlook. I also tried opening it in the desktop app, but that fails as well.