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 / Copilot Studio / File Upload in publish...
Copilot Studio
Suggested Answer

File Upload in published Agents not working

(0) ShareShare
ReportReport
Posted on by 11

Hi everyone,

I’m currently facing an issue where the file upload in a Copilot agent works through a question, but the file is not passed to the next step. After the upload, the bot immediately responds with
“I’m sorry, I couldn’t answer that. Is there something else I can help you with?”

In the question, I store the file in a variable and want to reuse this data (content, name), for example by passing it to a Power Automate flow.

Here’s what I’ve tried so far

Directly storing it in a variable, then accessing Topic.VarFileUpload.Content
Or using the system environment First(System.Activity.Attachments)

but no matter which method I use, the bot always gives the same response.

In the settings, orchestration for generative AI and file upload is enabled.

The function works without any issues inside Copilot Studio, but it does not work when using the shared agent in Microsoft 365 Copilot or Copilot in the browser.

Does anyone have an idea what might be causing this?

 

Thanks and regards,

Micha

2026-01-16 11_28_...

Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

I have the same question (0)
  • Suggested answer
    RaghavMishra Profile Picture
    77 on at

    Hi Micha,

    This is a common pattern issue when wiring up file uploads in Copilot Studio topics — the syntax of how the file variable is read and passed downstream matters a lot. Here are the official Microsoft Learn–documented steps to make this work reliably (especially when the agent is consumed via Microsoft 365 Copilot or the browser channel):

    1. Configure the Question node correctly

    In your Question node, under Identify, the type must be set to File. Then open the Question properties panel, go to the Entity recognition category, and enable Include file metadata. Without this flag, the downstream nodes won't get the full file payload reliably.

    2. Use the right reference to the uploaded file

    Once the file is captured into a variable (say Topic.userReceipt), the two properties you need are .Content (binary bytes) and .Name. So Topic.VarFileUpload.Content is correct in principle — just make sure the Question node's variable is actually typed as File and that "Include file metadata" is on.

    3. Passing the file to Power Automate / a tool

    When passing the file to a Power Automate flow added as a tool, in the tool's Inputs section, each flow input should expose a contentBytes and a name field. Set them as follows:

    • contentBytesFirst(System.Activity.Attachments).Content
    • nameFirst(System.Activity.Attachments).Name

    Or, when passing your variable directly, use this Power Fx record:

    { contentBytes: Topic.userReceipt.Content, name: Topic.userReceipt.Name }

    Inside the flow, set the input parameter type to File.

    4. M365 Copilot / browser channel specifics

    Using First(System.Activity.Attachments) is the recommended approach when the file is already attached to the conversation (e.g., a user drops a file into the M365 Copilot chat before triggering your topic). You can also combine both patterns — first check First(System.Activity.Attachments) with a Condition node, and fall back to a Question node if nothing was attached. This makes the topic resilient across channels.

    Reference: Pass files to agent flows, connectors, and tools – Microsoft Learn

    If after these checks the M365 Copilot channel still throws "I'm sorry, I couldn't answer that…" immediately after the upload, it's usually one of:

    • The Question node isn't typed as File (it falls back to a string interpreter).
    • "Include file metadata" is off, so .Content is empty and the downstream tool errors silently.
    • The flow input isn't declared as type File in Power Automate.

    Hope this helps you isolate the root cause!

     

    Raghav MishraLinkedIn | PowerAI Labs

    Found this helpful? Please mark ✅ "Does this answer your question?" so others searching for the same issue can find it quickly. A 👍 on "Was this reply helpful?" or a ♥ Like is also much appreciated!

  • Suggested answer
    Romain The Low-Code Bearded Bear Profile Picture
    2,866 Super User 2026 Season 1 on at
     
    Hello,  if everyhing work fine from copilot studio, but not in : teams, or in browser it's because when a message come from teams or copilot brower the file have been remove from First(System.Activity.Attachments) -> content
     
    It's empty :) easy way to test : just try to print content in the chat for test purpose or inside a power automate. (or test if is blanck
     
     
    Good way to be sure, you have the content from attchment (could have it from studio, teams, but not from chat/brower)
     
    so what you need to, since i m totally ok, all "old" tutos were good, it's a recent change from the teams behavior (made few test, more recently in some environnement, this behavior when back to original, so maybe it will not solve the problem), anyway : 
     
    what you have to do every time you want to use file in same topic in Studio and teams/brower : 
    At the begining of the node test if content is empty , if no : go as usual.
    If yes : good news : the file is somewhere : look in the "shared folder" of the conversation (every conversation, even with agent) have a shared folder in you'r personnal one drive , so next step : use one drive connector, get the filename from  First(System.Activity.Attachments) and then get the file from the one drive, get the content and then go back to the "good" path inside of the topic
     
    Last but not least : when an agent answer two time : it's because you didnt't put probably the "end conversation / end topic" at the end of the topc (you could also remove the system conversationnal boost, it's a non sense if you use gen AI orchestration, it's a relic of the past when you only had classic orchestration and sometime could trigger many time)
     
    (oh and if when you test, a connexion ask from credential, it will empty the content anyway)
     
    so here is a sample from one of my agent : 
     
    First create a variable with "content" inside, then test with a if , if blank : to to one drive get the file
    it will be there probably : 
    Something like this, depending of you'r language in one drive.
     
    you will need this connector : 
     
    and it will wait for path like this : /Fichiers Microsoft Copilot Chat/Incident_Report.docx
     
     
     
    lucky the tool give you the same file type as attachments :)
     
     
     
    Last tips : if you do anything like question, "if", genAI : before storing first the content, it will erase the content of the attachment.
     
    edit : very last tips : power automate error are hidden in teams and brower : but they are in activity log of the power automate from power automate window :) try to have a look there could help solve the problem too :)
     
    I hope this answer contain the solution for you :) if it help you plese mark the answer as verified, in green, it's very important for the community and the search engine :)

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 302

#2
Vish WR Profile Picture

Vish WR 240

#3
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 223 Super User 2026 Season 1

Last 30 days Overall leaderboard