web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Issues using the outpu...
Power Automate
Answered

Issues using the output of OneDrive "Get file content" action

(0) ShareShare
ReportReport
Posted on by 6
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: 
  1. Get response details
  2. Use a "parse json" action to transform the response to the file upload question
  3. Run an "apply to each" loop on the output of the parse json action
  4. Within that loop, use the OneDrive "get file content" action to get the file's contents
  5. 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.
Categories:
I have the same question (0)
  • Verified answer
    Ellis Karim Profile Picture
    12,059 Super User 2026 Season 1 on at
     
    You may need to change append to array /compose action to the format below, as in some instances, files won't open:
     
     
     
    Ellis Karim
    Ellis Karim
    elliskarim.com  |  LinkedIn  |  Bluesky
    If this solved your issue, please mark it as ✅ Accepted Answer. If it helped, feel free to give it a 🩷 Like!
  • CK-11021943-0 Profile Picture
    6 on at
    Thanks @Ellis Karim. I had to do a little finagling to get it to work, but it did. That's a real pain compared to just using the output of the Get file content action. It's also very strange that that content appears in a compose action just fine, but doesn't work adding to a variable.
     
    Here's what I ended up using:
     
    {
      "Name": "@{items('For_each')['name']}",
      "ContentBytes": {
        "$content-type": "@{outputs('Get_file_content')?['body']?['$content-type']}",
        "$content": "@{outputs('Get_file_content')?['body']?['$content']}"
      }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 816

#2
Valantis Profile Picture

Valantis 603

#3
Haque Profile Picture

Haque 566

Last 30 days Overall leaderboard